net.degreedays.api.data
Class LocationInfoRequest

java.lang.Object
  extended by net.degreedays.api.Request
      extended by net.degreedays.api.data.LocationInfoRequest
All Implemented Interfaces:
java.io.Serializable

public final class LocationInfoRequest
extends Request
implements java.io.Serializable

Defines a request for info about the station(s) that would be used to fulfil an equivalent 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.

See Also:
DataApi.getLocationInfo(LocationInfoRequest)

Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.


Constructor Summary
LocationInfoRequest(Location location, DataSpecs dataSpecs)
          Constructs a LocationInfoRequest object with the specified Location and DataSpecs.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocationInfoRequest

public LocationInfoRequest(Location location,
                           DataSpecs dataSpecs)
Constructs a LocationInfoRequest object with the specified Location and DataSpecs.

Parameters:
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.
Throws:
java.lang.NullPointerException - if location or dataSpecs is null.
Method Detail

location

public Location location()
Returns the non-null Location object for which data is desired.


dataSpecs

public DataSpecs dataSpecs()
Returns the non-null DataSpecs object that specifies the data that is desired from the specified location.


equals

public 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. In other words, they are equal if their dataSpecs() objects are equal and their location() objects are equal.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overridden to ensure consistency with equals.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.

The exact details of the representation are unspecified and subject to change.

Overrides:
toString in class java.lang.Object


www.degreedays.net/api/