@@ -29,21 +29,18 @@ public static class Spec {
2929 private final String project ;
3030 private final ValueType value ;
3131 private final String description ;
32- private final String joinKey ;
3332 private final Map <String , String > labels ;
3433
3534 protected Spec (
3635 String project ,
3736 String name ,
3837 ValueType value ,
3938 String description ,
40- String joinKey ,
4139 Map <String , String > labels ) {
4240 this .name = name ;
4341 this .project = project ;
4442 this .value = value ;
4543 this .description = description ;
46- this .joinKey = joinKey ;
4744 this .labels = labels ;
4845 }
4946
@@ -56,7 +53,6 @@ public static class Builder {
5653 private final String project ;
5754 private ValueType value ;
5855 private String description ;
59- private String joinKey ;
6056 private final Map <String , String > labels = new HashMap <>();
6157
6258 private Builder (String project , String name ) {
@@ -74,11 +70,6 @@ public Builder setDescription(String description) {
7470 return this ;
7571 }
7672
77- public Builder setJoinKey (String joinKey ) {
78- this .joinKey = joinKey ;
79- return this ;
80- }
81-
8273 public Builder addLabel (String key , String val ) {
8374 this .labels .put (key , val );
8475 return this ;
@@ -90,7 +81,7 @@ public Builder addLabels(Map<String, String> labels) {
9081 }
9182
9283 public Spec build () {
93- return new Spec (project , name , value , description , joinKey , labels );
84+ return new Spec (project , name , value , description , labels );
9485 }
9586 }
9687
@@ -110,30 +101,23 @@ public String getDescription() {
110101 return description ;
111102 }
112103
113- public String getJoinKey () {
114- return joinKey ;
115- }
116-
117104 public Map <String , String > getLabels () {
118105 return labels ;
119106 }
120107
121- protected Spec (EntityProto .EntitySpecV2 spec ) {
108+ protected Spec (String project , EntityProto .EntitySpecV2 spec ) {
109+ this .project = project ;
122110 this .name = spec .getName ();
123- this .project = spec .getProject ();
124111 this .value = ValueType .fromProto (spec .getValueType ());
125112 this .description = spec .getDescription ();
126- this .joinKey = spec .getJoinKey ();
127113 this .labels = spec .getLabelsMap ();
128114 }
129115
130116 protected EntityProto .EntitySpecV2 toProto () {
131117 return EntityProto .EntitySpecV2 .newBuilder ()
132118 .setName (name )
133- .setProject (project )
134119 .setValueType (value .toProto ())
135120 .setDescription (description )
136- .setJoinKey (joinKey )
137121 .putAllLabels (labels )
138122 .build ();
139123 }
@@ -147,8 +131,8 @@ public Metadata getMetadata() {
147131 return metadata ;
148132 }
149133
150- protected Entity (EntityProto .Entity entity ) {
151- if (entity .hasSpec ()) this .spec = new Spec (entity .getSpec ());
134+ protected Entity (String project , EntityProto .Entity entity ) {
135+ if (entity .hasSpec ()) this .spec = new Spec (project , entity .getSpec ());
152136 if (entity .hasMeta ()) this .metadata = new Metadata (entity .getMeta ());
153137 }
154138
0 commit comments