java.lang.Object
org.springframework.data.mongodb.core.geo.Sphere
All Implemented Interfaces:
Serializable, org.springframework.data.geo.Shape

public class Sphere extends Object implements org.springframework.data.geo.Shape
Represents a geospatial sphere value.
Since:
1.5
Author:
Thomas Darimont, Mark Paluch
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Sphere(org.springframework.data.geo.Circle circle)
    Creates a Sphere from the given Circle.
    Sphere(org.springframework.data.geo.Point center, double radius)
    Creates a Sphere around the given center Point with the given radius.
    Sphere(org.springframework.data.geo.Point center, org.springframework.data.geo.Distance radius)
    Creates a Sphere around the given center Point with the given radius.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<? extends Object>
    Returns the Shape as a list of usually Double or Lists of Doubles.
    boolean
     
    org.springframework.data.geo.Point
    Returns the center of the Circle.
    Returns the command to be used to create the $within criterion.
    org.springframework.data.geo.Distance
    Returns the radius of the Circle.
    int
     
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • Sphere

      public Sphere(org.springframework.data.geo.Point center, org.springframework.data.geo.Distance radius)
      Creates a Sphere around the given center Point with the given radius.
      Parameters:
      center - must not be null.
      radius - must not be null.
    • Sphere

      public Sphere(org.springframework.data.geo.Point center, double radius)
      Creates a Sphere around the given center Point with the given radius.
      Parameters:
      center - must not be null.
      radius -
    • Sphere

      public Sphere(org.springframework.data.geo.Circle circle)
      Creates a Sphere from the given Circle.
      Parameters:
      circle - must not be null.
  • Method Details

    • getCenter

      public org.springframework.data.geo.Point getCenter()
      Returns the center of the Circle.
      Returns:
      will never be null.
    • getRadius

      public org.springframework.data.geo.Distance getRadius()
      Returns the radius of the Circle.
      Returns:
      never null.
    • toString

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

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • asList

      public List<? extends Object> asList()
      Returns the Shape as a list of usually Double or Lists of Doubles. Wildcard bound to allow implementations to return a more concrete element type.
      Returns:
      never null.
    • getCommand

      public String getCommand()
      Returns the command to be used to create the $within criterion.
      Returns:
      never null.