Package com.cta4j.bus.route.model
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 displaydataFeed- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolor()Returns the value of thecolorrecord component.@Nullable StringdataFeed()Returns the value of thedataFeedrecord component.Returns the value of thedesignatorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Route
Constructs aRoute.- 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 displaydataFeed- the data feed identifier for the route, if applicable- Throws:
NullPointerException- ifid,name,color, ordesignatorisnull
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
designator
Returns the value of thedesignatorrecord component.- Returns:
- the value of the
designatorrecord component
-
dataFeed
Returns the value of thedataFeedrecord component.- Returns:
- the value of the
dataFeedrecord component
-