Class PAreaYSplitBD<S,T extends PAreaBDType<S>>

java.lang.Object
com.io7m.jregions.core.parameterized.areas.PAreaYSplitBD<S,T>
Type Parameters:
S - A phantom type parameter indicating the coordinate space of the area
T - The precise type of area
All Implemented Interfaces:
PAreaYSplitBDType<S,T>

public final class PAreaYSplitBD<S,T extends PAreaBDType<S>> extends Object implements PAreaYSplitBDType<S,T>
An area that has been split via the Y axis.
  • Method Details

    • lower

      public T lower()
      Specified by:
      lower in interface PAreaYSplitBDType<S,T extends PAreaBDType<S>>
      Returns:
      The lower half
    • upper

      public T upper()
      Specified by:
      upper in interface PAreaYSplitBDType<S,T extends PAreaBDType<S>>
      Returns:
      The upper half
    • withLower

      public final PAreaYSplitBD<S,T> withLower(T value)
      Copy the current immutable object by setting a value for the lower attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for lower
      Returns:
      A modified copy of the this object
    • withUpper

      public final PAreaYSplitBD<S,T> withUpper(T value)
      Copy the current immutable object by setting a value for the upper attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for upper
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of PAreaYSplitBD that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: lower, upper.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value PAreaYSplitBD with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static <S, T extends PAreaBDType<S>> PAreaYSplitBD<S,T> of(T lower, T upper)
      Construct a new immutable PAreaYSplitBD instance.
      Type Parameters:
      S - generic parameter S
      T - generic parameter T
      Parameters:
      lower - The value for the lower attribute
      upper - The value for the upper attribute
      Returns:
      An immutable PAreaYSplitBD instance
    • copyOf

      public static <S, T extends PAreaBDType<S>> PAreaYSplitBD<S,T> copyOf(PAreaYSplitBDType<S,T> instance)
      Creates an immutable copy of a PAreaYSplitBDType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      S - generic parameter S
      T - generic parameter T
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable PAreaYSplitBD instance
    • builder

      public static <S, T extends PAreaBDType<S>> PAreaYSplitBD.Builder<S,T> builder()
      Creates a builder for PAreaYSplitBD.
       PAreaYSplitBD.&lt;S, T&gt;builder()
          .setLower(T) // required lower
          .setUpper(T) // required upper
          .build();
       
      Type Parameters:
      S - generic parameter S
      T - generic parameter T
      Returns:
      A new PAreaYSplitBD builder