Record Class IncludePath
java.lang.Object
java.lang.Record
com.kazforge.jsonapi.representation.IncludePath
An ordered include path of JSON:API relationship names.
Use of(String) to parse a dotted path such as comments.author. Syntax
failures throw JsonApiMappingException with MappingDiagnostic.INVALID_INCLUDE_PATH.
-
Constructor Summary
ConstructorsConstructorDescriptionIncludePath(List<String> segments) Creates an instance of aIncludePathrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondotted()Returns the dotted JSON:API form of this path (for diagnostics).dottedThrough(int segmentIndex) Returns the dotted form of the path prefix throughsegmentIndex(inclusive).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static IncludePathParses a dotted include path.segments()Returns the value of thesegmentsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IncludePath
Creates an instance of aIncludePathrecord class.- Parameters:
segments- the value for thesegmentsrecord component
-
-
Method Details
-
of
Parses a dotted include path. Does not trim or otherwise normalize input. Rejects empty input, leading or trailing dots, repeated dots, and whitespace-only segments. -
dotted
Returns the dotted JSON:API form of this path (for diagnostics). -
dottedThrough
Returns the dotted form of the path prefix throughsegmentIndex(inclusive). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
segments
Returns the value of thesegmentsrecord component.- Returns:
- the value of the
segmentsrecord component
-