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

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

  • Constructor Details

    • Sphere

      public Sphere(Point center, 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(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(Circle circle)
      Creates a Sphere from the given Circle.
      Parameters:
      circle - must not be null.
  • Method Details

    • getCenter

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

      public 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.