Package com.cta4j.train.arrival.query
Record Class StopArrivalQuery
java.lang.Object
java.lang.Record
com.cta4j.train.arrival.query.StopArrivalQuery
- Record Components:
stopId- the ID of the stop to retrieve arrival information forline- the optional train line to filter arrival information bymaxResults- the optional maximum number of arrival information to return
@NullMarked
public record StopArrivalQuery(String stopId, @Nullable TrainLine line, @Nullable Integer maxResults)
extends Record
Represents a query for train arrival information for a specific stop.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder forStopArrivalQuery. -
Constructor Summary
ConstructorsConstructorDescriptionStopArrivalQuery(String stopId, @Nullable TrainLine line, @Nullable Integer maxResults) Constructs aStopArrivalQuery. -
Method Summary
Modifier and TypeMethodDescriptionstatic StopArrivalQuery.BuilderCreates a builder forStopArrivalQuery.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable TrainLineline()Returns the value of thelinerecord component.@Nullable IntegerReturns the value of themaxResultsrecord component.stopId()Returns the value of thestopIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StopArrivalQuery
Constructs aStopArrivalQuery.- Parameters:
stopId- the ID of the stop to retrieve arrival information forline- the optional train line to filter arrival information bymaxResults- the optional maximum number of arrival information to return- Throws:
NullPointerException- ifstopIdisnullIllegalArgumentException- ifmaxResultsis non-nulland not positive
-
-
Method Details
-
builder
Creates a builder forStopArrivalQuery.- Parameters:
stopId- the ID of the stop to retrieve arrival information for- Returns:
- a new
Builderinstance - Throws:
NullPointerException- ifstopIdisnull
-
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). -
stopId
Returns the value of thestopIdrecord component.- Returns:
- the value of the
stopIdrecord component
-
line
Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
maxResults
Returns the value of themaxResultsrecord component.- Returns:
- the value of the
maxResultsrecord component
-