Class BaseIncludeNodes<T extends BaseIncludeNodes<T>>
- java.lang.Object
-
- com.graphaware.common.policy.inclusion.BaseEntityInclusionPolicy<T>
-
- com.graphaware.common.policy.inclusion.fluent.IncludeEntities<T,Node>
-
- com.graphaware.common.policy.inclusion.fluent.BaseIncludeNodes<T>
-
- All Implemented Interfaces:
EntityInclusionPolicy<Node>
,InclusionPolicy
,NodeInclusionPolicy
,ObjectInclusionPolicy<Node>
- Direct Known Subclasses:
IncludeNodes
public abstract class BaseIncludeNodes<T extends BaseIncludeNodes<T>> extends IncludeEntities<T,Node> implements NodeInclusionPolicy
Abstract base class forNodeInclusionPolicy
implementations with fluent interface, intended to be used programmatically.
-
-
Constructor Summary
Constructors Constructor Description BaseIncludeNodes(String label, DetachedPropertiesDescription propertiesDescription)
Create a new policy.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getLabel()
Get the label with which this policy has been configured.int
hashCode()
boolean
include(Node node)
Include the given object?protected abstract T
newInstance(String label)
Create a new instance of this policy with the given label.T
with(String label)
Create a new policy from the current one, reconfigured to only match nodes with the given label.T
with(Label label)
Create a new policy from the current one, reconfigured to only match nodes with the given label.-
Methods inherited from class com.graphaware.common.policy.inclusion.fluent.IncludeEntities
getPropertiesDescription, newInstance, with
-
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
-
BaseIncludeNodes
public BaseIncludeNodes(String label, DetachedPropertiesDescription propertiesDescription)
Create a new policy.- Parameters:
label
- that matching nodes must have, can be null for all labels.propertiesDescription
- of the matching nodes.
-
-
Method Detail
-
with
public T with(String label)
Create a new policy from the current one, reconfigured to only match nodes with the given label.- Parameters:
label
- that matching nodes must have, can be null for all labels.- Returns:
- reconfigured policy.
-
with
public T with(Label label)
Create a new policy from the current one, reconfigured to only match nodes with the given label.- Parameters:
label
- that matching nodes must have, can be null for all labels.- Returns:
- reconfigured policy.
-
newInstance
protected abstract T newInstance(String label)
Create a new instance of this policy with the given label.- Parameters:
label
- of the new policy.- Returns:
- new policy.
-
include
public boolean include(Node node)
Description copied from interface:ObjectInclusionPolicy
Include the given object?- Specified by:
include
in interfaceObjectInclusionPolicy<T extends BaseIncludeNodes<T>>
- Overrides:
include
in classIncludeEntities<T extends BaseIncludeNodes<T>,Node>
- Parameters:
node
- to check.- Returns:
- true iff the given object should be included.
-
getLabel
public String getLabel()
Get the label with which this policy has been configured.- Returns:
- label, can be
null
(representing any label incl. none).
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classIncludeEntities<T extends BaseIncludeNodes<T>,Node>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classIncludeEntities<T extends BaseIncludeNodes<T>,Node>
-
-