Class BaseIncludeProperties<T extends BaseIncludeProperties<T,E>,E extends Entity>
- java.lang.Object
-
- com.graphaware.common.policy.inclusion.fluent.BaseIncludeProperties<T,E>
-
- All Implemented Interfaces:
InclusionPolicy
,PropertyInclusionPolicy<E>
- Direct Known Subclasses:
IncludeNodeProperties
,IncludeRelationshipProperties
public abstract class BaseIncludeProperties<T extends BaseIncludeProperties<T,E>,E extends Entity> extends Object implements PropertyInclusionPolicy<E>
Abstract base class forPropertyInclusionPolicy
implementations with fluent interface, intended to be used programmatically.
-
-
Constructor Summary
Constructors Constructor Description BaseIncludeProperties(String key)
Create a new policy.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getKey()
int
hashCode()
boolean
include(String key, E Entity)
Should a property with the given key of the given entity be included?protected abstract T
newInstance(String key)
Create a new instance of this policy with the given key.T
with(String key)
Create a new policy from the current one, reconfigured to only match properties with the given key.
-
-
-
Constructor Detail
-
BaseIncludeProperties
public BaseIncludeProperties(String key)
Create a new policy.- Parameters:
key
- that matching properties must have, can be null for all properties.
-
-
Method Detail
-
with
public T with(String key)
Create a new policy from the current one, reconfigured to only match properties with the given key.- Parameters:
key
- that matching properties must have, can be null for all properties.- Returns:
- reconfigured policy.
-
newInstance
protected abstract T newInstance(String key)
Create a new instance of this policy with the given key.- Parameters:
key
- of the new policy.- Returns:
- new policy.
-
include
public boolean include(String key, E Entity)
Description copied from interface:PropertyInclusionPolicy
Should a property with the given key of the given entity be included?- Specified by:
include
in interfacePropertyInclusionPolicy<T extends BaseIncludeProperties<T,E>>
- Parameters:
key
- of the property.Entity
- containing the property.- Returns:
- true iff the property should be included.
-
getKey
public String getKey()
-
-