public class ForecastRequestBuilder extends Object
ForecastRequest
objects.Modifier and Type | Class | Description |
---|---|---|
static class |
ForecastRequestBuilder.Block |
The blocks of the forecast response which can be excluded.
|
static class |
ForecastRequestBuilder.Language |
The available Languages in which the forecast response is translated.
|
static class |
ForecastRequestBuilder.Units |
Constructor | Description |
---|---|
ForecastRequestBuilder() |
Modifier and Type | Method | Description |
---|---|---|
ForecastRequest |
build() |
|
ForecastRequestBuilder |
exclude(ForecastRequestBuilder.Block... block) |
|
ForecastRequestBuilder |
extendHourly() |
When set, return hour-by-hour data for the next 168 hours, instead of the next 48.
|
ForecastRequestBuilder |
key(APIKey apiKey) |
|
ForecastRequestBuilder |
language(ForecastRequestBuilder.Language language) |
|
ForecastRequestBuilder |
location(GeoCoordinates geoCoordinates) |
|
ForecastRequestBuilder |
time(Instant time) |
|
ForecastRequestBuilder |
timeouts(Timeouts timeouts) |
|
ForecastRequestBuilder |
units(ForecastRequestBuilder.Units units) |
|
ForecastRequestBuilder |
url(String url) |
public ForecastRequestBuilder key(APIKey apiKey)
apiKey
- Your Dark Sky secret key. (Your secret key must be kept secret; in particular, do not embed it in JavaScript source code that you transmit to clients.)public ForecastRequestBuilder location(GeoCoordinates geoCoordinates)
geoCoordinates
- The Geo coordinates of a location for which the weather forecast is requested.public ForecastRequestBuilder url(String url)
url
- Override the default DarksSky API Url. The URL must contain the following patterns for the key and gelocation:public ForecastRequestBuilder language(ForecastRequestBuilder.Language language)
language
- The summary properties are returned in the desired language. (Note that units in the summary will be set according to the units parameter, so be sure to set
both parameters appropriately.)public ForecastRequestBuilder extendHourly()
public ForecastRequestBuilder exclude(ForecastRequestBuilder.Block... block)
block
- The Blocks which shall be excluded from the response to save data / latency. This method can be called multiple times and the exclusion will add up.public ForecastRequestBuilder units(ForecastRequestBuilder.Units units)
units
- Return weather conditions in the requested units.public ForecastRequestBuilder time(Instant time)
time
- The Time for which the historical weather data is returned.public ForecastRequestBuilder timeouts(Timeouts timeouts)
timeouts
- Override the default timeouts (6 seconds) for connection to the API and reading from the API.public ForecastRequest build()
Copyright © 2018. All rights reserved.