public static final class RegressionResponse.Builder
extends java.lang.Object
RegressionResponse
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.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
RegressionResponse.Builder |
addRegression(Regression regression) |
RegressionResponse.Builder |
addSource(Source source) |
RegressionResponse |
build() |
RegressionResponse.Builder |
setMetadata(ResponseMetadata metadata) |
RegressionResponse.Builder |
setRegressionsFailure(Failure failure) |
RegressionResponse.Builder |
setStationId(java.lang.String stationId) |
RegressionResponse.Builder |
setTargetLongLat(LongLat targetLongLat) |
public RegressionResponse.Builder setMetadata(ResponseMetadata metadata)
public RegressionResponse.Builder setStationId(java.lang.String stationId)
public RegressionResponse.Builder setTargetLongLat(LongLat targetLongLat)
public RegressionResponse.Builder addSource(Source source)
public RegressionResponse.Builder addRegression(Regression regression)
public RegressionResponse.Builder setRegressionsFailure(Failure failure)
public RegressionResponse build()
java.lang.IllegalStateException
- if the station ID and the
target longitude/latitude
have not both been set, if no sources have been added, if neither of
addRegression(net.degreedays.api.regression.Regression)
or
setRegressionsFailure(net.degreedays.api.Failure)
have been called, or if
both have been called (since it can't be a failure if
regressions have been added).
See www.degreedays.net/api/ for more about the Degree Days.net API.
You can sign up for a Degree Days.net API account and read the integration guide that is useful and applicable whether you are using Java or not.