Package com.cta4j.bus.prediction.query
Record Class StopsPredictionsQuery
java.lang.Object
java.lang.Record
com.cta4j.bus.prediction.query.StopsPredictionsQuery
- Record Components:
stopIds- theListof stop IDs to retrieve predictions forrouteIds- the optionalListof route IDs to filter predictions bymaxResults- the optional maximum number of predictions to return
@NullMarked
public record StopsPredictionsQuery(List<String> stopIds, @Nullable List<String> routeIds, @Nullable Integer maxResults)
extends Record
Represents a query for bus arrival predictions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder forStopsPredictionsQuery. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder forStopsPredictionsQuery.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable IntegerReturns the value of themaxResultsrecord component.routeIds()Returns the value of therouteIdsrecord component.stopIds()Returns the value of thestopIdsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StopsPredictionsQuery
public StopsPredictionsQuery(List<String> stopIds, @Nullable List<String> routeIds, @Nullable Integer maxResults) Constructs aStopsPredictionsQuery.- Parameters:
stopIds- theListof stop IDs to retrieve predictions forrouteIds- the optionalListof route IDs to filter predictions bymaxResults- the optional maximum number of predictions to return- Throws:
NullPointerException- ifstopIdsor any of its elements arenull, or if any element ofrouteIdsisnullIllegalArgumentException- ifmaxResultsis non-nulland not positive
-
-
Method Details
-
builder
Creates a builder forStopsPredictionsQuery.- Parameters:
stopIds- theListof stop IDs to retrieve predictions for- Returns:
- a new
Builderinstance - Throws:
NullPointerException- ifstopIdsor any of its elements arenull
-
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). -
stopIds
Returns the value of thestopIdsrecord component.- Returns:
- the value of the
stopIdsrecord component
-
routeIds
Returns the value of therouteIdsrecord component.- Returns:
- the value of the
routeIdsrecord component
-
maxResults
Returns the value of themaxResultsrecord component.- Returns:
- the value of the
maxResultsrecord component
-