Class NoOpConstraint
java.lang.Object
io.fluxzero.common.api.search.NoOpConstraint
- All Implemented Interfaces:
Constraint
A
Constraint implementation that matches all documents and imposes no filtering conditions.
This is typically used as a placeholder or default when no real constraint is needed. It always returns true
for matches(Document) and is considered to have no path constraints.
This constraint is used internally by various factory methods (such as those in MatchConstraint,
FacetConstraint, etc.) when an input is null, empty, or otherwise does not yield a meaningful constraint.
For example, MatchConstraint.match(null) returns a NoOpConstraint.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NoOpConstraintSingleton instance of the no-op constraint. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAlways returnsfalse, as this constraint is not tied to any document path.booleanAlways returnstrue, indicating that any document matches.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Constraint
and, decompose, or
-
Field Details
-
instance
Singleton instance of the no-op constraint.
-
-
Constructor Details
-
NoOpConstraint
public NoOpConstraint()
-
-
Method Details
-
matches
Always returnstrue, indicating that any document matches.- Specified by:
matchesin interfaceConstraint- Parameters:
document- the document to test- Returns:
trueif the constraint matches the document
-
hasPathConstraint
public boolean hasPathConstraint()Always returnsfalse, as this constraint is not tied to any document path.- Specified by:
hasPathConstraintin interfaceConstraint- Returns:
trueif path-based filtering is involved
-