Search in sources :

Example 6 with Occurrence

use of org.structr.api.search.Occurrence in project structr by structr.

the class TypeSearchAttribute method includeInResult.

@Override
public boolean includeInResult(final GraphObject entity) {
    final String nodeValue = entity.getProperty(getKey());
    final Occurrence occur = getOccurrence();
    final boolean isOfType = types.contains(nodeValue);
    if (occur.equals(Occurrence.FORBIDDEN)) {
        return !isOfType;
    } else {
        return isOfType;
    }
}
Also used : Occurrence(org.structr.api.search.Occurrence)

Aggregations

Occurrence (org.structr.api.search.Occurrence)6 Argument (graphql.language.Argument)1 BooleanValue (graphql.language.BooleanValue)1 IntValue (graphql.language.IntValue)1 ObjectValue (graphql.language.ObjectValue)1 StringValue (graphql.language.StringValue)1 Value (graphql.language.Value)1 LinkedList (java.util.LinkedList)1 PropertyKey (org.structr.core.property.PropertyKey)1 ConfigurationProvider (org.structr.schema.ConfigurationProvider)1