org.springframework.data.geo

## Class Polygon

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

All Implemented Interfaces:
  Serializable, Iterable<Point>, Shape

    public class Polygon
    extends Object
    implements Iterable<Point>, Shape

Simple value object to represent a `Polygon`.

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

### Constructor Summary

Constructors
Constructor and Description
`Polygon(List<? extends Point> points)` Creates a new `Polygon` for the given Points.
`Polygon(Point x, Point y, Point z, Point... others)` Creates a new `Polygon` for the given Points.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`List<Point>` `getPoints()` Returns all `Point`s the `Polygon` is made of.
`int` `hashCode()`
`Iterator<Point>` `iterator()`
`String` `toString()`

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Constructor Detail

#### Polygon

    public Polygon(Point x,
                   Point y,
                   Point z,
                   Point... others)

Creates a new `Polygon` for the given Points.

Parameters:
  `x` - must not be null.
  `y` - must not be null.
  `z` - must not be null.
  `others` -

#### Polygon

    public Polygon(List<? extends Point> points)

Creates a new `Polygon` for the given Points.

Parameters:
  `points` - must not be null.

### Method Detail

#### getPoints

    public List<Point> getPoints()

Returns all `Point`s the `Polygon` is made of.

Returns:

#### iterator

    public Iterator<Point> iterator()

Specified by:
  `iterator` in interface `Iterable<Point>`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`