Package com.cta4j.train.station.model
Record Class Station
java.lang.Object
java.lang.Record
com.cta4j.train.station.model.Station
- Record Components:
stopId- the unique stop identifier of this stationdirection- theCardinalDirectionof this stationstopName- the stop name of this stationname- the name of this stationdescriptiveName- the descriptive name of this stationmapId- the map identifier of this stationadaAccessible- whether this station is ADA accessiblelines- theListofTrainLines that serve this stationlocation- theLocationof this station
@NullMarked
public record Station(String stopId, CardinalDirection direction, String stopName, String name, String descriptiveName, String mapId, boolean adaAccessible, List<TrainLine> lines, Location location)
extends Record
Represents a train station.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theadaAccessiblerecord component.Returns the value of thedescriptiveNamerecord component.Returns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.lines()Returns the value of thelinesrecord component.location()Returns the value of thelocationrecord component.mapId()Returns the value of themapIdrecord component.name()Returns the value of thenamerecord component.stopId()Returns the value of thestopIdrecord component.stopName()Returns the value of thestopNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Station
public Station(String stopId, CardinalDirection direction, String stopName, String name, String descriptiveName, String mapId, boolean adaAccessible, List<TrainLine> lines, Location location) Constructs aStation.- Parameters:
stopId- the unique stop identifier of the stationdirection- theCardinalDirectionof the stationstopName- the stop name of the stationname- the name of the stationdescriptiveName- the descriptive name of the stationmapId- the map identifier of the stationadaAccessible- whether the station is ADA accessiblelines- theListofTrainLines that serve the stationlocation- theLocationof the station- Throws:
NullPointerException- ifstopId,direction,stopName,name,descriptiveName,mapId,lines, orlocationisnull, or if any element oflinesisnull
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
stopId
Returns the value of thestopIdrecord component.- Returns:
- the value of the
stopIdrecord component
-
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-
stopName
Returns the value of thestopNamerecord component.- Returns:
- the value of the
stopNamerecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
descriptiveName
Returns the value of thedescriptiveNamerecord component.- Returns:
- the value of the
descriptiveNamerecord component
-
mapId
Returns the value of themapIdrecord component.- Returns:
- the value of the
mapIdrecord component
-
adaAccessible
public boolean adaAccessible()Returns the value of theadaAccessiblerecord component.- Returns:
- the value of the
adaAccessiblerecord component
-
lines
Returns the value of thelinesrecord component.- Returns:
- the value of the
linesrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-