public final class LocationInfoRequest extends Request implements java.io.Serializable
LocationDataRequest
. This is effectively a lightweight
alternative to LocationDataRequest
, primarily for use when you
want to know what station ID the API would use for a given
GeographicLocation
, without the overhead of actually fetching any
data.
A successfully-processed LocationInfoRequest
will result in a
LocationInfoResponse
.
LocationInfoRequest
mirrors LocationDataRequest
, so see
that class's docs for information on how to create a
LocationInfoRequest
.
DataApi.getLocationInfo(LocationInfoRequest)
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Constructor and Description |
---|
LocationInfoRequest(Location location,
DataSpecs dataSpecs)
Constructs a
LocationInfoRequest object with the specified
Location and DataSpecs . |
Modifier and Type | Method and Description |
---|---|
DataSpecs |
dataSpecs()
Returns the non-null
DataSpecs object that specifies the
data that is desired from the specified location. |
boolean |
equals(java.lang.Object o)
Two
LocationInfoRequest objects are equal if it can be
ascertained that they are specifying the same set(s) of data from the
same location. |
int |
hashCode()
Overridden to ensure consistency with
equals . |
Location |
location()
Returns the non-null
Location object for which data is
desired. |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.
|
public LocationInfoRequest(Location location, DataSpecs dataSpecs)
LocationInfoRequest
object with the specified
Location
and DataSpecs
.location
- the non-null location for which data is desired.dataSpecs
- the non-null specification of the data that is desired from
the specified location.java.lang.NullPointerException
- if location
or dataSpecs
is
null
.public Location location()
Location
object for which data is
desired.public DataSpecs dataSpecs()
DataSpecs
object that specifies the
data that is desired from the specified location.public boolean equals(java.lang.Object o)
LocationInfoRequest
objects are equal if it can be
ascertained that they are specifying the same set(s) of data from the
same location. In other words, they are equal if their
dataSpecs()
objects are equal and their location()
objects are equal.equals
in class java.lang.Object
public int hashCode()
equals
.hashCode
in class java.lang.Object
public java.lang.String toString()
The exact details of the representation are unspecified and subject to change.
toString
in class java.lang.Object
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.