Search in sources :

Example 1 with RawLongSerialiser

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();
}
Also used : StringSerialiser(uk.gov.gchq.gaffer.serialisation.implementation.StringSerialiser) StringToStringSerialiser(uk.gov.gchq.gaffer.serialisation.implementation.tostring.StringToStringSerialiser) MapSerialiser(uk.gov.gchq.gaffer.serialisation.implementation.MapSerialiser) RawLongSerialiser(uk.gov.gchq.gaffer.serialisation.implementation.raw.RawLongSerialiser) ElementFilter(uk.gov.gchq.gaffer.data.element.function.ElementFilter) ExampleFilterFunction(uk.gov.gchq.gaffer.function.ExampleFilterFunction)

Aggregations

ElementFilter (uk.gov.gchq.gaffer.data.element.function.ElementFilter)1 ExampleFilterFunction (uk.gov.gchq.gaffer.function.ExampleFilterFunction)1 MapSerialiser (uk.gov.gchq.gaffer.serialisation.implementation.MapSerialiser)1 StringSerialiser (uk.gov.gchq.gaffer.serialisation.implementation.StringSerialiser)1 RawLongSerialiser (uk.gov.gchq.gaffer.serialisation.implementation.raw.RawLongSerialiser)1 StringToStringSerialiser (uk.gov.gchq.gaffer.serialisation.implementation.tostring.StringToStringSerialiser)1