net.degreedays.api.data
Class LocationDataResponse.Builder
java.lang.Object
net.degreedays.api.data.LocationDataResponse.Builder
- Enclosing class:
- LocationDataResponse
public static final class LocationDataResponse.Builder
- extends java.lang.Object
A builder class for creating immutable LocationDataResponse
objects e.g. for testing purposes.
Instances of this builder class are designed for single-threaded use only. It's fine to create and use instances in multiple concurrent threads, but, in the absence of external synchronization, the use of each individual builder instance should be restricted to one thread only.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocationDataResponse.Builder
public LocationDataResponse.Builder()
setMetadata
public LocationDataResponse.Builder setMetadata(ResponseMetadata metadata)
setStationId
public LocationDataResponse.Builder setStationId(java.lang.String stationId)
setTargetLongLat
public LocationDataResponse.Builder setTargetLongLat(LongLat targetLongLat)
addSource
public LocationDataResponse.Builder addSource(Source source)
setDataSets
public LocationDataResponse.Builder setDataSets(DataSets dataSets)
build
public LocationDataResponse build()
- Throws:
java.lang.IllegalStateException
- if the
station ID, the
target longitude/latitude, and
the DataSets have not all been set,
or if no sources have been added.
www.degreedays.net/api/