Class Rectangle

All Implemented Interfaces:
JsonSerializable

public class Rectangle extends Marker<@NotNull Rectangle>
Represents a rectangle marker.
  • Constructor Details

    • Rectangle

      public Rectangle(@NotNull @NotNull String key, double x1, double z1, double x2, double z2)
      Create a new rectangle.
      Parameters:
      key - identifying key
      x1 - first x point
      z1 - first z point
      x2 - second x point
      z2 - second z point
    • Rectangle

      public Rectangle(@NotNull @NotNull String key, @NotNull @NotNull Point point1, @NotNull @NotNull Point point2)
      Create a new rectangle.
      Parameters:
      key - identifying key
      point1 - first point
      point2 - second point
  • Method Details

    • of

      @NotNull public static @NotNull Rectangle of(@NotNull @NotNull String key, double x1, double z1, double x2, double z2)
      Create a new rectangle.
      Parameters:
      key - identifying key
      x1 - first x point
      z1 - first z point
      x2 - second x point
      z2 - second z point
      Returns:
      a new rectangle
    • of

      @NotNull public static @NotNull Rectangle of(@NotNull @NotNull String key, @NotNull @NotNull Point point1, @NotNull @NotNull Point point2)
      Create a new rectangle.
      Parameters:
      key - identifying key
      point1 - first point
      point2 - second point
      Returns:
      a new rectangle
    • getPoint1

      @NotNull public @NotNull Point getPoint1()
      Get the first Point of this rectangle.
      Returns:
      first point
    • setPoint1

      @NotNull public @NotNull Rectangle setPoint1(@NotNull @NotNull Point point1)
      Set the first Point of this rectangle.
      Parameters:
      point1 - first point
      Returns:
      this rectangle
    • getPoint2

      @NotNull public @NotNull Point getPoint2()
      Get the second Point of this rectangle.
      Returns:
      second point
    • setPoint2

      @NotNull public @NotNull Rectangle setPoint2(@NotNull @NotNull Point point2)
      Set the second Point of this rectangle.
      Parameters:
      point2 - second point
      Returns:
      this rectangle
    • 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 Rectangle 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