Class IncludeEntities<C extends IncludeEntities<?,T>,T extends Entity>
- java.lang.Object
-
- com.graphaware.common.policy.inclusion.BaseEntityInclusionPolicy<T>
-
- com.graphaware.common.policy.inclusion.fluent.IncludeEntities<C,T>
-
- All Implemented Interfaces:
EntityInclusionPolicy<T>
,InclusionPolicy
,ObjectInclusionPolicy<T>
- Direct Known Subclasses:
BaseIncludeNodes
,BaseIncludeRelationships
public abstract class IncludeEntities<C extends IncludeEntities<?,T>,T extends Entity> extends BaseEntityInclusionPolicy<T> implements EntityInclusionPolicy<T>
An abstract base-class forEntityInclusionPolicy
implementations that are based on property valuePredicate
s. In other words, the implementations can be used to specify, whichEntity
s to include based on the presence and/or value of their properties.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
IncludeEntities(DetachedPropertiesDescription propertiesDescription)
Construct a new policy.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
DetachedPropertiesDescription
getPropertiesDescription()
Get the properties description with which this policy has been configured.int
hashCode()
boolean
include(T entity)
Include the given object?protected abstract C
newInstance(DetachedPropertiesDescription propertiesDescription)
Create a new instance of this policy reconfigured with a different properties description.C
with(String propertyKey, Predicate predicate)
Construct a new description from this description by adding/replacing a predicate with a new one.-
Methods inherited from class com.graphaware.common.policy.inclusion.BaseEntityInclusionPolicy
doGetAll, getAll
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.graphaware.common.policy.inclusion.EntityInclusionPolicy
getAll
-
-
-
-
Constructor Detail
-
IncludeEntities
protected IncludeEntities(DetachedPropertiesDescription propertiesDescription)
Construct a new policy.- Parameters:
propertiesDescription
- description of properties an includedEntity
must fulfill. More precisely, aLiteralPropertiesDescription
of theEntity
must be more specific than the given properties description.
-
-
Method Detail
-
with
public C with(String propertyKey, Predicate predicate)
Construct a new description from this description by adding/replacing a predicate with a new one.- Parameters:
propertyKey
- key of the property the predicate is for.predicate
- the predicate.- Returns:
- a new instance of properties description.
-
newInstance
protected abstract C newInstance(DetachedPropertiesDescription propertiesDescription)
Create a new instance of this policy reconfigured with a different properties description.- Parameters:
propertiesDescription
- of the new instance.- Returns:
- new instance.
-
getPropertiesDescription
public DetachedPropertiesDescription getPropertiesDescription()
Get the properties description with which this policy has been configured.- Returns:
- properties description.
-
include
public boolean include(T entity)
Description copied from interface:ObjectInclusionPolicy
Include the given object?- Specified by:
include
in interfaceObjectInclusionPolicy<C extends IncludeEntities<?,T>>
- Parameters:
entity
- to check.- Returns:
- true iff the given object should be included.
-
-