Record Class Route

java.lang.Object
java.lang.Record
com.cta4j.bus.route.model.Route
Record Components:
id - the alphanumeric designator of this route (e.g., "22", "J14", "X9")
name - the common name of this route (e.g., "Clark", "Jeffery Jump", "Ashland Express")
color - the color of this route used in maps (e.g., "#ffffff")
designator - the language-specific route designator of this route, intended for display
dataFeed - the data feed identifier for this route, if applicable

@NullMarked public record Route(String id, String name, String color, String designator, @Nullable String dataFeed) extends Record
Represents a bus route.

NOTE: dataFeed is not well-documented by the CTA. As such, its presence here is primarily for completeness and may not be populated or described correctly.

  • Constructor Details

    • Route

      public Route(String id, String name, String color, String designator, @Nullable String dataFeed)
      Constructs a Route.
      Parameters:
      id - the alphanumeric designator of the route (e.g., "22", "J14", "X9")
      name - the common name of the route (e.g., "Clark", "Jeffery Jump", "Ashland Express")
      color - the color of the route used in maps (e.g., "#ffffff")
      designator - the language-specific route designator of the route, intended for display
      dataFeed - the data feed identifier for the route, if applicable
      Throws:
      NullPointerException - if id, name, color, or designator is null
  • Method Details

    • 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • color

      public String color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • designator

      public String designator()
      Returns the value of the designator record component.
      Returns:
      the value of the designator record component
    • dataFeed

      public @Nullable String dataFeed()
      Returns the value of the dataFeed record component.
      Returns:
      the value of the dataFeed record component