Class Shape.Builder

java.lang.Object
de.bluecolored.bluemap.api.math.Shape.Builder
Enclosing class:
Shape

public static class Shape.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • addPoint

      public Shape.Builder addPoint(Vector2d point)
      Adds a point to the end of line.
      Parameters:
      point - the point to be added.
      Returns:
      this builder for chaining
    • addPoints

      public Shape.Builder addPoints(Vector2d... points)
      Adds multiple points to the end of line.
      Parameters:
      points - the points to be added.
      Returns:
      this builder for chaining
    • addPoints

      public Shape.Builder addPoints(Collection<Vector2d> points)
      Adds multiple points to the end of line.
      Parameters:
      points - the points to be added.
      Returns:
      this builder for chaining
    • build

      public Shape build()
      Builds a new Shape with the points set in this builder.
      There need to be at least 3 points to build a Shape.
      Returns:
      the new Shape
      Throws:
      IllegalStateException - if there are less than 3 points added to this builder