Package org.opentripplanner.client.model
Record Class Leg
java.lang.Object
java.lang.Record
org.opentripplanner.client.model.Leg
public record Leg(Place from, Place to, OffsetDateTime startTime, OffsetDateTime endTime, LegMode mode, Duration duration, double distance, Route route, List<FareProductUse> fareProducts, OptionalDouble accessibilityScore)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionLeg(Place from, Place to, OffsetDateTime startTime, OffsetDateTime endTime, LegMode mode, Duration duration, double distance, Route route, List<FareProductUse> fareProducts, OptionalDouble accessibilityScore) Creates an instance of aLegrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessibilityScorerecord component.doubledistance()Returns the value of thedistancerecord component.duration()Returns the value of thedurationrecord component.endTime()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.Returns 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(Place from, Place to, OffsetDateTime startTime, OffsetDateTime endTime, LegMode mode, Duration duration, double distance, Route route, List<FareProductUse> fareProducts, OptionalDouble accessibilityScore) 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 componentaccessibilityScore- the value for theaccessibilityScorerecord 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
Returns the value of thestartTimerecord component.- Returns:
- the value of the
startTimerecord component
-
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
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
-
accessibilityScore
Returns the value of theaccessibilityScorerecord component.- Returns:
- the value of the
accessibilityScorerecord component
-