Class GeoPoint

java.lang.Object
com.google.cloud.firestore.GeoPoint
All Implemented Interfaces:
Serializable

public class GeoPoint extends Object implements Serializable
Immutable class representing a geographic location in Firestore
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeoPoint(double latitude, double longitude)
    Construct a new GeoPoint using the provided latitude and longitude values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this GeoPoint is equal to the provided object.
    double
    Returns the latitude.
    double
    Returns the longitude.
    int
     
     

    Methods inherited from class java.lang.Object

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

    • GeoPoint

      public GeoPoint(double latitude, double longitude)
      Construct a new GeoPoint using the provided latitude and longitude values.
      Parameters:
      latitude - The latitude of this GeoPoint in the range [-90, 90].
      longitude - The longitude of this GeoPoint in the range [-180, 180].
  • Method Details

    • getLatitude

      public double getLatitude()
      Returns the latitude.
      Returns:
      The latitude value of this GeoPoint.
    • getLongitude

      public double getLongitude()
      Returns the longitude.
      Returns:
      The longitude value of this GeoPoint.
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Returns true if this GeoPoint is equal to the provided object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare against.
      Returns:
      Whether this GeoPoint is equal to the provided object.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object