Record Class RouteSpec
java.lang.Object
java.lang.Record
com.graphhopper.jsprit.core.problem.solution.spec.RouteSpec
- Record Components:
vehicleId- the ID of the vehicle for this routeactivities- the ordered list of activities in this route
Specifies one route in a solution.
This is pure data - no actual VehicleRoute or Activity objects are referenced. The spec is materialized into a real route when building the solution.
-
Constructor Summary
ConstructorsConstructorDescriptionRouteSpec(String vehicleId, List<ActivitySpec> activities) Creates an instance of aRouteSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactivitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.static RouteSpecfrom(VehicleRoute route) Extracts a route spec from an existing route.final inthashCode()Returns a hash code value for this object.static RouteSpecof(String vehicleId, ActivitySpec... activities) Creates a route spec with the given activities.static RouteSpecof(String vehicleId, List<ActivitySpec> activities) Creates a route spec with the given activities.final StringtoString()Returns a string representation of this record class.Returns the value of thevehicleIdrecord component.
-
Constructor Details
-
RouteSpec
Creates an instance of aRouteSpecrecord class.- Parameters:
vehicleId- the value for thevehicleIdrecord componentactivities- the value for theactivitiesrecord component
-
-
Method Details
-
of
Creates a route spec with the given activities. -
of
Creates a route spec with the given activities. -
from
Extracts a route spec from an existing route.- Parameters:
route- the route to extract from- Returns:
- a spec representing the route's structure
-
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). -
vehicleId
Returns the value of thevehicleIdrecord component.- Returns:
- the value of the
vehicleIdrecord component
-
activities
Returns the value of theactivitiesrecord component.- Returns:
- the value of the
activitiesrecord component
-