Package com.cta4j.train.common.model
Record Class Arrival
java.lang.Object
java.lang.Record
com.cta4j.train.common.model.Arrival
- Record Components:
stationId- the unique identifier of the station for which this arrival was generatedstationName- the display name of the station for which this arrival was generatedstopId- the unique identifier of the stop for which this arrival was generatedstopDescription- the display name of the stop for which this arrival was generatedline- the train line associated with this arrivaldestinationStationId- the unique identifier of the destination station for this arrivaldestinationName- the display name of the destination station for this arrivalpredictionTime- the date and time (UTC) this arrival was generatedarrivalTime- the date and time (UTC) of a train’s arrival or departure to the stop associated with this arrivalapproaching- whether the train associated with this arrival is currently approaching the stopscheduled- whether this arrival is based on a scheduled time rather than a real-time predictiondelayed- whether the train associated with this arrival is currently delayedfault- whether the train associated with this arrival is currently experiencing a faultmetadata- the metadata associated with this arrival
@NullMarked
public record Arrival(String stationId, String stationName, String stopId, String stopDescription, TrainLine line, String destinationStationId, String destinationName, Instant predictionTime, Instant arrivalTime, boolean approaching, boolean scheduled, boolean delayed, boolean fault, ArrivalMetadata metadata)
extends Record
Represents a train arrival.
-
Constructor Summary
ConstructorsConstructorDescriptionArrival(String stationId, String stationName, String stopId, String stopDescription, TrainLine line, String destinationStationId, String destinationName, Instant predictionTime, Instant arrivalTime, boolean approaching, boolean scheduled, boolean delayed, boolean fault, ArrivalMetadata metadata) Constructs anArrival. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theapproachingrecord component.Returns the value of thearrivalTimerecord component.booleandelayed()Returns the value of thedelayedrecord component.Returns the value of thedestinationNamerecord component.Returns the value of thedestinationStationIdrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanfault()Returns the value of thefaultrecord component.final inthashCode()Returns a hash code value for this object.line()Returns the value of thelinerecord component.metadata()Returns the value of themetadatarecord component.Returns the value of thepredictionTimerecord component.booleanReturns the value of thescheduledrecord component.Returns the value of thestationIdrecord component.Returns the value of thestationNamerecord component.Returns the value of thestopDescriptionrecord component.stopId()Returns the value of thestopIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Arrival
public Arrival(String stationId, String stationName, String stopId, String stopDescription, TrainLine line, String destinationStationId, String destinationName, Instant predictionTime, Instant arrivalTime, boolean approaching, boolean scheduled, boolean delayed, boolean fault, ArrivalMetadata metadata) Constructs anArrival.- Parameters:
stationId- the unique identifier of the station for which the arrival was generatedstationName- the display name of the station for which the arrival was generatedstopId- the unique identifier of the stop for which the arrival was generatedstopDescription- the display name of the stop for which the arrival was generatedline- the train line associated with the arrivaldestinationStationId- the unique identifier of the destination station for the arrivaldestinationName- the display name of the destination station for the arrivalpredictionTime- the date and time (UTC) the arrival was generatedarrivalTime- the date and time (UTC) of a train’s arrival or departure to the stop associated with the arrivalapproaching- whether the train associated with the arrival is currently approaching the stopscheduled- whether the arrival is based on a scheduled time rather than a real-time predictiondelayed- whether the train associated with the arrival is currently delayedfault- whether the train associated with the arrival is currently experiencing a faultmetadata- the metadata associated with the arrival- Throws:
NullPointerException- ifstationId,stationName,stopId,stopDescription,line,destinationStationId,destinationName,predictionTime,arrivalTime, ormetadataisnull
-
-
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 '=='. -
stationId
Returns the value of thestationIdrecord component.- Returns:
- the value of the
stationIdrecord component
-
stationName
Returns the value of thestationNamerecord component.- Returns:
- the value of the
stationNamerecord component
-
stopId
Returns the value of thestopIdrecord component.- Returns:
- the value of the
stopIdrecord component
-
stopDescription
Returns the value of thestopDescriptionrecord component.- Returns:
- the value of the
stopDescriptionrecord component
-
line
Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
destinationStationId
Returns the value of thedestinationStationIdrecord component.- Returns:
- the value of the
destinationStationIdrecord component
-
destinationName
Returns the value of thedestinationNamerecord component.- Returns:
- the value of the
destinationNamerecord component
-
predictionTime
Returns the value of thepredictionTimerecord component.- Returns:
- the value of the
predictionTimerecord component
-
arrivalTime
Returns the value of thearrivalTimerecord component.- Returns:
- the value of the
arrivalTimerecord component
-
approaching
public boolean approaching()Returns the value of theapproachingrecord component.- Returns:
- the value of the
approachingrecord component
-
scheduled
public boolean scheduled()Returns the value of thescheduledrecord component.- Returns:
- the value of the
scheduledrecord component
-
delayed
public boolean delayed()Returns the value of thedelayedrecord component.- Returns:
- the value of the
delayedrecord component
-
fault
public boolean fault()Returns the value of thefaultrecord component.- Returns:
- the value of the
faultrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-