org.springframework.data.geo

## Class Box

- java.lang.Object
- - org.springframework.data.geo.Box

All Implemented Interfaces:
  Serializable, Shape

    public class Box
    extends Object
    implements Shape

Represents a geospatial box value

Since:
  1.8
Author:
  Mark Pollack, Oliver Gierke, Thomas Darimont
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`Box(double[] first, double[] second)` Creates a new Box from the given `first` to the `second` point represented as the double[].
`Box(Point first, Point second)` Creates a new Box spanning from the given first to the second `Point`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object obj)`
`Point` `getFirst()` Returns the first `Point` making up the `Box`.
`Point` `getSecond()` Returns the second `Point` making up the `Box`.
`int` `hashCode()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Box

    public Box(Point first,
               Point second)

Creates a new Box spanning from the given first to the second `Point`.

Parameters:
  `first` - must not be null.
  `second` - must not be null.

#### Box

    public Box(double[] first,
               double[] second)

Creates a new Box from the given `first` to the `second` point represented as the double[].

Parameters:
  `first` - must not be null and contain exactly 2 doubles.
  `second` - must not be null and contain exactly 2 doubles.

### Method Detail

#### getFirst

    public Point getFirst()

Returns the first `Point` making up the `Box`.

Returns:

#### getSecond

    public Point getSecond()

Returns the second `Point` making up the `Box`.

Returns:

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(@Nullable
                          Object obj)

Overrides:
  `equals` in class `Object`