Class NoOpConstraint
java.lang.Object
io.fluxcapacitor.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 NoOpConstraint
Singleton instance of the no-op constraint. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Always returnsfalse
, as this constraint is not tied to any document path.boolean
Always returnstrue
, indicating that any document matches.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.common.api.search.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:
matches
in interfaceConstraint
- Parameters:
document
- the document to test- Returns:
true
if the constraint matches the document
-
hasPathConstraint
public boolean hasPathConstraint()Always returnsfalse
, as this constraint is not tied to any document path.- Specified by:
hasPathConstraint
in interfaceConstraint
- Returns:
true
if path-based filtering is involved
-