Package com.cta4j.train.common.model
Record Class ArrivalMetadata
java.lang.Object
java.lang.Record
com.cta4j.train.common.model.ArrivalMetadata
- Record Components:
runNumber- the run number of the train associated with this arrivaldirection- the direction of travel of the train associated with this arrivalcoordinates- the coordinates of the train associated with this arrival, if applicableflags- the flags associated with this arrival, if applicable
@NullMarked
public record ArrivalMetadata(String runNumber, TrainDirection direction, @Nullable Coordinates coordinates, @Nullable String flags)
extends Record
Represents metadata associated with a train arrival.
-
Constructor Summary
ConstructorsConstructorDescriptionArrivalMetadata(String runNumber, TrainDirection direction, @Nullable Coordinates coordinates, @Nullable String flags) Constructs anArrivalMetadata. -
Method Summary
Modifier and TypeMethodDescription@Nullable CoordinatesReturns the value of thecoordinatesrecord component.Returns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Stringflags()Returns the value of theflagsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of therunNumberrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ArrivalMetadata
public ArrivalMetadata(String runNumber, TrainDirection direction, @Nullable Coordinates coordinates, @Nullable String flags) Constructs anArrivalMetadata.- Parameters:
runNumber- the run number of the train associated with the arrivaldirection- the direction of travel of the train associated with the arrivalcoordinates- the coordinates of the train associated with the arrival, if applicableflags- the flags associated with the arrival, if applicable- Throws:
NullPointerException- ifrunNumberordirectionisnull
-
-
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). -
runNumber
Returns the value of therunNumberrecord component.- Returns:
- the value of the
runNumberrecord component
-
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-
coordinates
Returns the value of thecoordinatesrecord component.- Returns:
- the value of the
coordinatesrecord component
-
flags
Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-