21
21
22
22
import grakn .client .GraknClient ;
23
23
import grakn .client .concept .AttributeType ;
24
+ import grakn .client .concept .Concept ;
24
25
import grakn .client .concept .ConceptId ;
25
26
import grakn .client .concept .Label ;
26
27
import grakn .client .exception .GraknClientException ;
@@ -162,14 +163,14 @@ public static SessionProto.Transaction.Req iterate(int iteratorId) {
162
163
*/
163
164
public static class ConceptMessage {
164
165
165
- public static ConceptProto .Concept from (grakn . client . concept . Concept concept ) {
166
+ public static ConceptProto .Concept from (Concept concept ) {
166
167
return ConceptProto .Concept .newBuilder ()
167
168
.setId (concept .id ().getValue ())
168
169
.setBaseType (getBaseType (concept ))
169
170
.build ();
170
171
}
171
172
172
- private static ConceptProto .Concept .BASE_TYPE getBaseType (grakn . client . concept . Concept concept ) {
173
+ private static ConceptProto .Concept .BASE_TYPE getBaseType (Concept concept ) {
173
174
if (concept .isEntityType ()) {
174
175
return ConceptProto .Concept .BASE_TYPE .ENTITY_TYPE ;
175
176
} else if (concept .isRelationType ()) {
@@ -193,7 +194,7 @@ private static ConceptProto.Concept.BASE_TYPE getBaseType(grakn.client.concept.C
193
194
}
194
195
}
195
196
196
- public static Collection <ConceptProto .Concept > concepts (Collection <grakn . client . concept . Concept > concepts ) {
197
+ public static Collection <ConceptProto .Concept > concepts (Collection <Concept > concepts ) {
197
198
return concepts .stream ().map (ConceptMessage ::from ).collect (toList ());
198
199
}
199
200
@@ -222,42 +223,42 @@ public static ConceptProto.ValueObject attributeValue(Object value) {
222
223
return builder .build ();
223
224
}
224
225
225
- public static grakn . client . concept . AttributeType .DataType dataType (ConceptProto .AttributeType .DATA_TYPE dataType ) {
226
+ public static AttributeType .DataType dataType (ConceptProto .AttributeType .DATA_TYPE dataType ) {
226
227
switch (dataType ) {
227
228
case STRING :
228
- return grakn . client . concept . AttributeType .DataType .STRING ;
229
+ return AttributeType .DataType .STRING ;
229
230
case BOOLEAN :
230
- return grakn . client . concept . AttributeType .DataType .BOOLEAN ;
231
+ return AttributeType .DataType .BOOLEAN ;
231
232
case INTEGER :
232
- return grakn . client . concept . AttributeType .DataType .INTEGER ;
233
+ return AttributeType .DataType .INTEGER ;
233
234
case LONG :
234
- return grakn . client . concept . AttributeType .DataType .LONG ;
235
+ return AttributeType .DataType .LONG ;
235
236
case FLOAT :
236
- return grakn . client . concept . AttributeType .DataType .FLOAT ;
237
+ return AttributeType .DataType .FLOAT ;
237
238
case DOUBLE :
238
- return grakn . client . concept . AttributeType .DataType .DOUBLE ;
239
+ return AttributeType .DataType .DOUBLE ;
239
240
case DATE :
240
- return grakn . client . concept . AttributeType .DataType .DATE ;
241
+ return AttributeType .DataType .DATE ;
241
242
default :
242
243
case UNRECOGNIZED :
243
244
throw new IllegalArgumentException ("Unrecognised " + dataType );
244
245
}
245
246
}
246
247
247
- static ConceptProto .AttributeType .DATA_TYPE setDataType (grakn . client . concept . AttributeType .DataType dataType ) {
248
- if (dataType .equals ( grakn . client . concept . AttributeType .DataType .STRING )) {
248
+ static ConceptProto .AttributeType .DATA_TYPE setDataType (AttributeType .DataType dataType ) {
249
+ if (dataType .equals ( AttributeType .DataType .STRING )) {
249
250
return ConceptProto .AttributeType .DATA_TYPE .STRING ;
250
- } else if (dataType .equals ( grakn . client . concept . AttributeType .DataType .BOOLEAN )) {
251
+ } else if (dataType .equals ( AttributeType .DataType .BOOLEAN )) {
251
252
return ConceptProto .AttributeType .DATA_TYPE .BOOLEAN ;
252
- } else if (dataType .equals ( grakn . client . concept . AttributeType .DataType .INTEGER )) {
253
+ } else if (dataType .equals ( AttributeType .DataType .INTEGER )) {
253
254
return ConceptProto .AttributeType .DATA_TYPE .INTEGER ;
254
- } else if (dataType .equals ( grakn . client . concept . AttributeType .DataType .LONG )) {
255
+ } else if (dataType .equals ( AttributeType .DataType .LONG )) {
255
256
return ConceptProto .AttributeType .DATA_TYPE .LONG ;
256
- } else if (dataType .equals ( grakn . client . concept . AttributeType .DataType .FLOAT )) {
257
+ } else if (dataType .equals ( AttributeType .DataType .FLOAT )) {
257
258
return ConceptProto .AttributeType .DATA_TYPE .FLOAT ;
258
- } else if (dataType .equals ( grakn . client . concept . AttributeType .DataType .DOUBLE )) {
259
+ } else if (dataType .equals ( AttributeType .DataType .DOUBLE )) {
259
260
return ConceptProto .AttributeType .DATA_TYPE .DOUBLE ;
260
- } else if (dataType .equals ( grakn . client . concept . AttributeType .DataType .DATE )) {
261
+ } else if (dataType .equals ( AttributeType .DataType .DATE )) {
261
262
return ConceptProto .AttributeType .DATA_TYPE .DATE ;
262
263
} else {
263
264
throw GraknClientException .unreachableStatement ("Unrecognised " + dataType );
0 commit comments