Class MultiPolygon

java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.markers.marker.Marker<@NotNull MultiPolygon>
net.pl3x.map.core.markers.marker.MultiPolygon
All Implemented Interfaces:
JsonSerializable

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

    • MultiPolygon

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

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

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

    • of

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Keyed