Package io.fluxcapacitor.common.search
Class Document.Path
java.lang.Object
io.fluxcapacitor.common.search.Document.Path
- Enclosing class:
Document
Represents a navigable field access path for a
Document
entry.
A Path
is used to locate or filter entries within a document's hierarchical structure (e.g., nested
objects or arrays). It supports glob-based pattern matching and two normalized representations:
- Short form: omits numeric indices used in list paths (e.g.
items/price
) - Long form: includes all components, such as array indices (e.g.
items/0/price
)
Examples
new Path("customer/addresses/1/city").getShortValue(); // "customer/addresses/city"
new Path("customer/addresses/1/city").getLongValue(); // "customer/addresses/1/city"
Paths are typically normalized during search and comparison to ensure consistent behavior regardless of source data structure.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Document.Path
Singleton instance representing an empty path. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isLongPath
(String queryPath) Determines whether a given path string qualifies as a "long path".static Predicate
<Document.Path> pathPredicate
(String queryPath) Constructs a predicate to matchDocument.Path
instances against the given glob-style path query.Splits a path string into individual elements (unescaped), using/
as the delimiter.
-
Field Details
-
EMPTY_PATH
Singleton instance representing an empty path.
-
-
Constructor Details
-
Path
public Path()
-
-
Method Details
-
split
Splits a path string into individual elements (unescaped), using/
as the delimiter.- Parameters:
path
- path string to split- Returns:
- stream of path components (e.g.
["foo", "bar", "name"]
)
-
isLongPath
Determines whether a given path string qualifies as a "long path".A path is considered long if any of its components are numeric (indicating array indices).
- Parameters:
queryPath
- path string to analyze- Returns:
- true if the path includes numeric segments, false otherwise
-
pathPredicate
Constructs a predicate to matchDocument.Path
instances against the given glob-style path query.Internally distinguishes between short and long paths for matching.
- Parameters:
queryPath
- a glob pattern such asfoo/name
- Returns:
- a predicate that matches paths by their normalized form
-