N
- The specific type of graph node this matcher can operate on.
Must extend OnlyToDirectedGraphNodeI
.@FunctionalInterface
public interface GraphNodeMatcherI<N extends OnlyToDirectedGraphNodeI>
OnlyToDirectedGraphNodeI
)
must meet to be considered a "match". This interface provides a method to check
nodes against these criteria.
As this interface contains a single abstract method, it is a
FunctionalInterface
and can be implemented using a lambda expression
(e.g., node -> node.getSomeProperty().equals("value")
) or a method reference
in Java 8 and later.
Modifier and Type | Method and Description |
---|---|
static <T extends OnlyToDirectedGraphNodeI> |
acceptAll()
Returns a matcher that accepts all nodes of type T.
|
default GraphNodeMatcherI<N> |
and(GraphNodeMatcherI<? super N> other)
Returns a composed matcher that represents a short-circuiting logical AND of
this matcher and another.
|
boolean |
fits(N node)
Checks if the given node matches the criteria defined by this matcher.
|
default GraphNodeMatcherI<N> |
negate()
Returns a matcher that represents the logical negation of this matcher.
|
static <T extends OnlyToDirectedGraphNodeI> |
ofType(java.lang.Class<? extends T> type)
Returns a matcher that checks if a node is an instance of a specific class.
|
default GraphNodeMatcherI<N> |
or(GraphNodeMatcherI<? super N> other)
Returns a composed matcher that represents a short-circuiting logical OR of
this matcher and another.
|
static <T extends OnlyToDirectedGraphNodeI> |
rejectAll()
Returns a matcher that rejects all nodes of type T.
|
boolean fits(N node)
node
- The graph node (of type N
) to check against the matcher's criteria.
Implementations should define behavior for null inputs,
though typically callers should avoid passing null.true
if the given node matches the criteria of this matcher;
false
otherwise.default GraphNodeMatcherI<N> and(GraphNodeMatcherI<? super N> other)
false
, then the other
matcher is not evaluated.other
- a GraphNodeMatcherI
(for type N or its supertypes) that will be
logically-ANDed with this matcher. Using <? super N>
for flexibility.other
matcherjava.lang.NullPointerException
- if other is nulldefault GraphNodeMatcherI<N> or(GraphNodeMatcherI<? super N> other)
true
, then the other
matcher is not evaluated.other
- a GraphNodeMatcherI
(for type N or its supertypes) that will be
logically-ORed with this matcher. Using <? super N>
for flexibility.other
matcherjava.lang.NullPointerException
- if other is nulldefault GraphNodeMatcherI<N> negate()
static <T extends OnlyToDirectedGraphNodeI> GraphNodeMatcherI<T> acceptAll()
T
- The type of the node.static <T extends OnlyToDirectedGraphNodeI> GraphNodeMatcherI<T> rejectAll()
T
- The type of the node.static <T extends OnlyToDirectedGraphNodeI> GraphNodeMatcherI<T> ofType(java.lang.Class<? extends T> type)
T
- The base type of the node.type
- The class to match against.java.lang.NullPointerException
- if type is nullCopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.