use of uk.gov.gchq.gaffer.serialisation.implementation.raw.RawLongSerialiser in project Gaffer by gchq.
the class SchemaTest method createSchema.
private Schema createSchema() {
MapSerialiser mapSerialiser = new MapSerialiser();
mapSerialiser.setKeySerialiser(new StringSerialiser());
mapSerialiser.setValueSerialiser(new RawLongSerialiser());
mapSerialiser.setMapClass(LinkedHashMap.class);
return new Schema.Builder().edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().source(TestTypes.ID_STRING).destination(TestTypes.ID_STRING).property(TestPropertyNames.PROP_1, TestTypes.PROP_STRING).property(TestPropertyNames.PROP_2, TestTypes.PROP_INTEGER).property(TestPropertyNames.TIMESTAMP, TestTypes.TIMESTAMP).groupBy(TestPropertyNames.PROP_1).description(EDGE_DESCRIPTION).validator(new ElementFilter.Builder().select(TestPropertyNames.PROP_1).execute(new ExampleFilterFunction()).build()).build()).entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().vertex(TestTypes.ID_STRING).property(TestPropertyNames.PROP_1, TestTypes.PROP_STRING).property(TestPropertyNames.PROP_2, TestTypes.PROP_INTEGER).property(TestPropertyNames.TIMESTAMP, TestTypes.TIMESTAMP).groupBy(TestPropertyNames.PROP_1).description(EDGE_DESCRIPTION).validator(new ElementFilter.Builder().select(TestPropertyNames.PROP_1).execute(new ExampleFilterFunction()).build()).build()).type(TestTypes.ID_STRING, new TypeDefinition.Builder().clazz(String.class).description(STRING_TYPE_DESCRIPTION).build()).type(TestTypes.PROP_MAP, new TypeDefinition.Builder().description(MAP_TYPE_DESCRIPTION).clazz(LinkedHashMap.class).serialiser(mapSerialiser).build()).type(TestTypes.PROP_STRING, new TypeDefinition.Builder().clazz(String.class).description(STRING_TYPE_DESCRIPTION).build()).type(TestTypes.PROP_INTEGER, new TypeDefinition.Builder().clazz(Integer.class).description(INTEGER_TYPE_DESCRIPTION).build()).type(TestTypes.TIMESTAMP, new TypeDefinition.Builder().clazz(Long.class).description(TIMESTAMP_TYPE_DESCRIPTION).build()).visibilityProperty(TestPropertyNames.VISIBILITY).timestampProperty(TestPropertyNames.TIMESTAMP).config("key", "value").build();
}
Aggregations