Record Class FieldPath
java.lang.Object
java.lang.Record
dev.hardwood.metadata.FieldPath
- Record Components:
elements- the path components from root to leaf
Path from the root schema to a leaf column, represented as a list of field names.
For flat schemas, the path has a single element (the column name).
For nested schemas, it contains each intermediate group name
(e.g. ["address", "zip"] for a zip field inside an address struct).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionelements()Returns the value of theelementsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Whether this path is empty (has no elements) or not.leafName()Returns the leaf (last) element of the path.booleanmatchesDottedName(String dottedName) Returns true if this path matches the given dotted name.static FieldPathCreates a FieldPath from individual path components.Returns the first (top-level) element of the path.toString()Returns the dot-separated string representation of this path.
-
Constructor Details
-
FieldPath
-
-
Method Details
-
of
-
leafName
Returns the leaf (last) element of the path. -
topLevelName
Returns the first (top-level) element of the path. -
matchesDottedName
Returns true if this path matches the given dotted name.
A dotted name like
"address.zip"matches the path["address", "zip"]. A prefix match is allowed:"address"matches["address", "zip"](useful for filtering on a top-level field that contains nested columns).- Parameters:
dottedName- a dot-separated field reference (e.g."address.zip")- Returns:
- true if this path matches the dotted name
-
toString
-
isEmpty
public boolean isEmpty()Whether this path is empty (has no elements) or not. -
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
elements
-