Package org.opentripplanner.client.model
Record Class TripPlan.Leg
java.lang.Object
java.lang.Record
org.opentripplanner.client.model.TripPlan.Leg
- Enclosing class:
- TripPlan
public static record TripPlan.Leg(TripPlan.Place from, TripPlan.Place to, java.time.OffsetDateTime startTime, java.time.OffsetDateTime endTime, LegMode mode, java.time.Duration duration, double distance, TripPlan.Route route, List<TripPlan.FareProductUse> fareProducts)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionLeg(TripPlan.Place from, TripPlan.Place to, java.time.OffsetDateTime startTime, java.time.OffsetDateTime endTime, LegMode mode, java.time.Duration duration, double distance, TripPlan.Route route, List<TripPlan.FareProductUse> fareProducts) Creates an instance of aLegrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledistance()Returns the value of thedistancerecord component.java.time.Durationduration()Returns the value of thedurationrecord component.java.time.OffsetDateTimeendTime()Returns the value of theendTimerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefareProductsrecord component.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.booleanIs this leg using public transport?mode()Returns the value of themoderecord component.route()Returns the value of therouterecord component.java.time.OffsetDateTimeReturns the value of thestartTimerecord component.to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Leg
public Leg(TripPlan.Place from, TripPlan.Place to, java.time.OffsetDateTime startTime, java.time.OffsetDateTime endTime, LegMode mode, java.time.Duration duration, double distance, TripPlan.Route route, List<TripPlan.FareProductUse> fareProducts) Creates an instance of aLegrecord class.- Parameters:
from- the value for thefromrecord componentto- the value for thetorecord componentstartTime- the value for thestartTimerecord componentendTime- the value for theendTimerecord componentmode- the value for themoderecord componentduration- the value for thedurationrecord componentdistance- the value for thedistancerecord componentroute- the value for therouterecord componentfareProducts- the value for thefareProductsrecord component
-
-
Method Details
-
isTransit
public boolean isTransit()Is this leg using public transport? -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
from
Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-
startTime
public java.time.OffsetDateTime startTime()Returns the value of thestartTimerecord component.- Returns:
- the value of the
startTimerecord component
-
endTime
public java.time.OffsetDateTime endTime()Returns the value of theendTimerecord component.- Returns:
- the value of the
endTimerecord component
-
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
duration
public java.time.Duration duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
distance
public double distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-
route
Returns the value of therouterecord component.- Returns:
- the value of the
routerecord component
-
fareProducts
Returns the value of thefareProductsrecord component.- Returns:
- the value of the
fareProductsrecord component
-