Class RangeInclusiveB

java.lang.Object
com.io7m.jranges.RangeInclusiveB
All Implemented Interfaces:
RangeInclusiveBType

public final class RangeInclusiveB extends Object implements RangeInclusiveBType
An inclusive range with BigInteger components.
  • Method Details

    • lower

      public BigInteger lower()
      Specified by:
      lower in interface RangeInclusiveBType
      Returns:
      The lower bound of the inclusive range.
    • upper

      public BigInteger upper()
      Specified by:
      upper in interface RangeInclusiveBType
      Returns:
      The upper bound of the inclusive range.
    • withLower

      public final RangeInclusiveB withLower(BigInteger value)
      Copy the current immutable object by setting a value for the lower attribute. An equals check 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 RangeInclusiveB withUpper(BigInteger value)
      Copy the current immutable object by setting a value for the upper attribute. An equals check 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 RangeInclusiveB 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 RangeInclusiveB with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static RangeInclusiveB of(BigInteger lower, BigInteger upper)
      Construct a new immutable RangeInclusiveB instance.
      Parameters:
      lower - The value for the lower attribute
      upper - The value for the upper attribute
      Returns:
      An immutable RangeInclusiveB instance
    • copyOf

      public static RangeInclusiveB copyOf(RangeInclusiveBType instance)
      Creates an immutable copy of a RangeInclusiveBType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable RangeInclusiveB instance
    • builder

      public static RangeInclusiveB.Builder builder()
      Creates a builder for RangeInclusiveB.
       RangeInclusiveB.builder()
          .setLower(java.math.BigInteger) // required lower
          .setUpper(java.math.BigInteger) // required upper
          .build();
       
      Returns:
      A new RangeInclusiveB builder