Record Class ActivitySpec
java.lang.Object
java.lang.Record
com.graphhopper.jsprit.core.problem.solution.spec.ActivitySpec
- Record Components:
jobId- the ID of the job this activity belongs totype- which activity of the job (VISIT for single-stop, PICKUP/DELIVERY for shipments)options- optional overrides (null = use defaults)
Specifies one activity in a route.
This is pure data - no actual Activity objects are referenced. The spec is materialized into real activities when building the solution.
-
Constructor Summary
ConstructorsConstructorDescriptionActivitySpec(String jobId, ActivityType type, ActivityOptions options) Creates an instance of aActivitySpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ActivitySpecCreates a DELIVERY activity spec (for shipments).final booleanIndicates whether some other object is "equal to" this one.static ActivitySpecfrom(TourActivity.JobActivity activity) Extracts an activity spec from an existing job activity.final inthashCode()Returns a hash code value for this object.jobId()Returns the value of thejobIdrecord component.static ActivitySpecof(String jobId, ActivityType type) Creates an activity spec with default options.options()Returns the value of theoptionsrecord component.static ActivitySpecCreates a PICKUP activity spec (for shipments).final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.static ActivitySpecCreates a VISIT activity spec (for single-stop jobs).
-
Constructor Details
-
Method Details
-
of
Creates an activity spec with default options. -
visit
Creates a VISIT activity spec (for single-stop jobs). -
pickup
Creates a PICKUP activity spec (for shipments). -
delivery
Creates a DELIVERY activity spec (for shipments). -
from
Extracts an activity spec from an existing job activity.- Parameters:
activity- the job activity to extract from- Returns:
- a spec representing the activity
-
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). -
jobId
Returns the value of thejobIdrecord component.- Returns:
- the value of the
jobIdrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-