Record Class Route

java.lang.Object
java.lang.Record
org.opentripplanner.client.model.Route

public record Route(Optional<String> shortName, Optional<String> longName, TransitMode mode, Agency agency) extends Record
  • Constructor Details

    • Route

      public Route(Optional<String> shortName, Optional<String> longName, TransitMode mode, Agency agency)
      Creates an instance of a Route record class.
      Parameters:
      shortName - the value for the shortName record component
      longName - the value for the longName record component
      mode - the value for the mode record component
      agency - the value for the agency record component
  • Method Details

    • name

      public String name()
      Either the short name (if it has one) or the long name.

      Either is optional but one must exist.

    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • shortName

      public Optional<String> shortName()
      Returns the value of the shortName record component.
      Returns:
      the value of the shortName record component
    • longName

      public Optional<String> longName()
      Returns the value of the longName record component.
      Returns:
      the value of the longName record component
    • mode

      public TransitMode mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • agency

      public Agency agency()
      Returns the value of the agency record component.
      Returns:
      the value of the agency record component