Package frc.robot.lib.BLine
Record Class JsonUtils.ParsedPathComponents
java.lang.Object
java.lang.Record
frc.robot.lib.BLine.JsonUtils.ParsedPathComponents
- Record Components:
elements- The list of parsed path elementsconstraints- The parsed path-specific constraintsdefaultGlobalConstraints- The default global constraints to use
- Enclosing class:
- JsonUtils
public static record JsonUtils.ParsedPathComponents(ArrayList<Path.PathElement> elements, Path.PathConstraints constraints, Path.DefaultGlobalConstraints defaultGlobalConstraints)
extends Record
Container for parsed path components without constructing a full Path object.
This record is useful for separating JSON parsing from Path construction, which can be helpful for performance measurements or when you need to inspect the parsed data before creating a Path.
-
Constructor Summary
ConstructorsConstructorDescriptionParsedPathComponents(ArrayList<Path.PathElement> elements, Path.PathConstraints constraints, Path.DefaultGlobalConstraints defaultGlobalConstraints) Creates an instance of aParsedPathComponentsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconstraintsrecord component.Returns the value of thedefaultGlobalConstraintsrecord component.elements()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.toPath()Constructs a Path from these parsed components.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ParsedPathComponents
public ParsedPathComponents(ArrayList<Path.PathElement> elements, Path.PathConstraints constraints, Path.DefaultGlobalConstraints defaultGlobalConstraints) Creates an instance of aParsedPathComponentsrecord class.- Parameters:
elements- the value for theelementsrecord componentconstraints- the value for theconstraintsrecord componentdefaultGlobalConstraints- the value for thedefaultGlobalConstraintsrecord component
-
-
Method Details
-
toPath
Constructs a Path from these parsed components.This method creates a new Path using the pre-parsed components, avoiding the overhead of JSON parsing.
- Returns:
- A new Path constructed from the parsed components
-
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). -
elements
Returns the value of theelementsrecord component.- Returns:
- the value of the
elementsrecord component
-
constraints
Returns the value of theconstraintsrecord component.- Returns:
- the value of the
constraintsrecord component
-
defaultGlobalConstraints
Returns the value of thedefaultGlobalConstraintsrecord component.- Returns:
- the value of the
defaultGlobalConstraintsrecord component
-