Class GeocodingRequest

java.lang.Object
com.massifmaps.geocoding.GeocodingRequest

public class GeocodingRequest extends Object
A geocoding request describing text-based query and other optional constraints.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeocodingRequest(Projection projection, String query)
    Constructs a new GeocodingRequest object from a projection and a string-based query.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if this object is equal to the specified object.
    Returns the custom parameter value of the request.
    Returns the location attribute of the request.
    The matching address near the specified location (up to a specified radius) are preferred.
    float
    Returns the location radius attribute of the request (in meters).
    Returns the projection of the request.
    Returns the text-based query of the request.
    int
    Returns the hash value of this object.
    void
    Sets a custom parameter value for the the request.
    void
    Sets the location attribute of the request.
    The matching address near the specified location (up to a specified radius) are preferred.
    void
    setLocationRadius(float radius)
    Sets the location radius attribute of the request.
    The default is 0, which means that location based ranking is not applied.
    Creates a string representation of this request object, useful for logging.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GeocodingRequest

      public GeocodingRequest(Projection projection, String query)
      Constructs a new GeocodingRequest object from a projection and a string-based query.
      Parameters:
      projection - The projection to use for the result and location data.
      query - The text-based query.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • getQuery

      public String getQuery()
      Returns the text-based query of the request.
      Returns:
      The text-based query of the request.
    • getProjection

      public Projection getProjection()
      Returns the projection of the request.
      Returns:
      The projection of the request.
    • getLocation

      public MapPos getLocation()
      Returns the location attribute of the request.
      The matching address near the specified location (up to a specified radius) are preferred.
      Returns:
      The location attribute of the request.
    • setLocation

      public void setLocation(MapPos pos)
      Sets the location attribute of the request.
      The matching address near the specified location (up to a specified radius) are preferred.
      Parameters:
      pos - The new location for the request.
    • getLocationRadius

      public float getLocationRadius()
      Returns the location radius attribute of the request (in meters).
      Returns:
      The location radius attribute of the request in meters.
    • setLocationRadius

      public void setLocationRadius(float radius)
      Sets the location radius attribute of the request.
      The default is 0, which means that location based ranking is not applied.
      Parameters:
      radius - The location radius attribute of the request in meters.
    • getCustomParameter

      public Variant getCustomParameter(String param)
      Returns the custom parameter value of the request.
      Parameters:
      param - The name of the parameter to return.
      Returns:
      The value of the parameter. If the parameter does not exist, empty variant is returned.
    • setCustomParameter

      public void setCustomParameter(String param, Variant value)
      Sets a custom parameter value for the the request.
      Parameters:
      param - The name of the parameter. For example, "ranking.location_sigma".
      value - The new value for the parameter.
    • toString

      public String toString()
      Creates a string representation of this request object, useful for logging.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this request object.