Package com.cta4j.train.arrival.query
Class StopArrivalQuery.Builder
java.lang.Object
com.cta4j.train.arrival.query.StopArrivalQuery.Builder
- Enclosing class:
StopArrivalQuery
A builder for
StopArrivalQuery.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theStopArrivalQuery.Sets the train line to filter arrival information by.maxResults(Integer maxResults) Sets the maximum number of arrival information to return.
-
Constructor Details
-
Builder
Constructs aBuilder.- Parameters:
stopId- the ID of the stop to retrieve arrival information for- Throws:
NullPointerException- ifstopIdisnull
-
-
Method Details
-
line
Sets the train line to filter arrival information by.- Parameters:
line- the train line- Returns:
- this
Builderinstance - Throws:
NullPointerException- iflineisnull
-
maxResults
Sets the maximum number of arrival information to return.- Parameters:
maxResults- the maximum number of arrival information- Returns:
- this
Builderinstance - Throws:
NullPointerException- ifmaxResultsisnullIllegalArgumentException- ifmaxResultsis not positive
-
build
Builds theStopArrivalQuery.- Returns:
- a new
StopArrivalQueryinstance
-