Search in sources :

Example 11 with IdentifierType

use of uk.gov.gchq.gaffer.data.element.IdentifierType in project Gaffer by gchq.

the class MapGenerator method getFieldValue.

private Object getFieldValue(final Element element, final String key) {
    final IdentifierType idType = IdentifierType.fromName(key);
    final Object value;
    if (null == idType) {
        if (GROUP.equals(key)) {
            value = element.getGroup();
        } else {
            value = element.getProperty(key);
        }
    } else {
        value = element.getIdentifier(idType);
    }
    return value;
}
Also used : IdentifierType(uk.gov.gchq.gaffer.data.element.IdentifierType)

Aggregations

IdentifierType (uk.gov.gchq.gaffer.data.element.IdentifierType)11 Test (org.junit.Test)5 ElementFilter (uk.gov.gchq.gaffer.data.element.function.ElementFilter)3 AggregateFunction (uk.gov.gchq.gaffer.function.AggregateFunction)3 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 ElementAggregator (uk.gov.gchq.gaffer.data.element.function.ElementAggregator)2 ConsumerFunction (uk.gov.gchq.gaffer.function.ConsumerFunction)2 PassThroughFunctionContext (uk.gov.gchq.gaffer.function.context.PassThroughFunctionContext)2 ConsumerProducerFunction (uk.gov.gchq.gaffer.function.ConsumerProducerFunction)1 FilterFunction (uk.gov.gchq.gaffer.function.FilterFunction)1 TransformFunction (uk.gov.gchq.gaffer.function.TransformFunction)1