Class MultiPolygon

All Implemented Interfaces:
JsonSerializable

@NullMarked public class MultiPolygon extends Marker<MultiPolygon>
Represents a multi-polygon marker.
  • Constructor Details

    • MultiPolygon

      public MultiPolygon(String key, Polygon polygon)
      Create a new multi-polygon.
      Parameters:
      key - identifying key
      polygon - polygon to add
    • MultiPolygon

      public MultiPolygon(String key, Polygon... polygons)
      Create a new multi-polygon.
      Parameters:
      key - identifying key
      polygons - polygons to add
    • MultiPolygon

      public MultiPolygon(String key, Collection<Polygon> polygons)
      Create a new multi-polygon.
      Parameters:
      key - identifying key
      polygons - polygons to add
  • Method Details

    • of

      public static MultiPolygon of(String key, Polygon polygon)
      Create a new multi-polygon.
      Parameters:
      key - identifying key
      polygon - polygon to add
      Returns:
      a new multi-polygon
    • of

      public static MultiPolygon of(String key, Polygon... polygons)
      Create a new multi-polygon.
      Parameters:
      key - identifying key
      polygons - polygons to add
      Returns:
      a new multi-polygon
    • of

      public static MultiPolygon of(String key, Collection<Polygon> polygons)
      Create a new multi-polygon.
      Parameters:
      key - identifying key
      polygons - polygons to add
      Returns:
      a new multi-polygon
    • getPolygons

      public List<Polygon> getPolygons()
      Get the list of polygons in this multi-polygon.
      Returns:
      list of polygons
    • clearPolygons

      public MultiPolygon clearPolygons()
      Clear the list of polygons in this multi-polygon.
      Returns:
      this multi-polygon
    • addPolygon

      public MultiPolygon addPolygon(Polygon polygon)
      Add a polygon to this multi-polygon.
      Parameters:
      polygon - polygon to add
      Returns:
      this multi-polygon
    • addPolygon

      public MultiPolygon addPolygon(Polygon... polygons)
      Add polygons to this multi-polygon.
      Parameters:
      polygons - polygons to add
      Returns:
      this multi-polygon
    • addPolygon

      public MultiPolygon addPolygon(Collection<Polygon> polygons)
      Add polygons to this multi-polygon.
      Parameters:
      polygons - polygons to add
      Returns:
      this multi-polygon
    • removePoly

      public MultiPolygon removePoly(Polygon polygon)
      Remove a polygon from this multi-polygon.
      Parameters:
      polygon - polygon to remove
      Returns:
      this multi-polygon
    • removePoly

      public MultiPolygon removePoly(Polygon... polygons)
      Remove polygons from this multi-polygon.
      Parameters:
      polygons - polygons to remove
      Returns:
      this multi-polygon
    • removePoly

      public MultiPolygon removePoly(Collection<Polygon> polygons)
      Remove polygons from this multi-polygon.
      Parameters:
      polygons - polygons to remove
      Returns:
      this multi-polygon
    • toJson

      public com.google.gson.JsonObject toJson()
      Description copied from interface: JsonSerializable
      Jsonify this object.
      Returns:
      object as json element
    • fromJson

      public static MultiPolygon fromJson(com.google.gson.JsonObject obj)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Keyed
    • toString

      public String toString()
      Overrides:
      toString in class Keyed