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 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 a Leg record class.
      Parameters:
      from - the value for the from record component
      to - the value for the to record component
      startTime - the value for the startTime record component
      endTime - the value for the endTime record component
      mode - the value for the mode record component
      duration - the value for the duration record component
      distance - the value for the distance record component
      route - the value for the route record component
      fareProducts - the value for the fareProducts record component
  • Method Details

    • isTransit

      public boolean isTransit()
      Is this leg using public transport?
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • from

      public TripPlan.Place from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • to

      public TripPlan.Place to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • startTime

      public java.time.OffsetDateTime startTime()
      Returns the value of the startTime record component.
      Returns:
      the value of the startTime record component
    • endTime

      public java.time.OffsetDateTime endTime()
      Returns the value of the endTime record component.
      Returns:
      the value of the endTime record component
    • mode

      public LegMode mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • duration

      public java.time.Duration duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • distance

      public double distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component
    • route

      public TripPlan.Route route()
      Returns the value of the route record component.
      Returns:
      the value of the route record component
    • fareProducts

      public List<TripPlan.FareProductUse> fareProducts()
      Returns the value of the fareProducts record component.
      Returns:
      the value of the fareProducts record component