java.lang.Object
com.github.jh3nd3rs0n.jargyle.common.number.PositiveInteger

public final class PositiveInteger extends Object
An integer between 1 and 2147483647 (inclusive).
  • Field Details

    • MAX_INT_VALUE

      public static final int MAX_INT_VALUE
      The maximum int value of a positive integer.
      See Also:
    • MIN_INT_VALUE

      public static final int MIN_INT_VALUE
      The minimum int value of a positive integer.
      See Also:
  • Method Details

    • valueOf

      public static PositiveInteger valueOf(int i)
      Returns a PositiveInteger of the provided int value. An IllegalArgumentException is thrown if the provided int value is less than 1.
      Parameters:
      i - the provided int value
      Returns:
      a PositiveInteger of the provided int value
    • valueOf

      public static PositiveInteger valueOf(String s)
      Returns a PositiveInteger of the provided String. An IllegalArgumentException is thrown if the provided String is not an integer between 1 and 2147483647 (inclusive).
      Parameters:
      s - the provided String
      Returns:
      a PositiveInteger of the provided String
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • intValue

      public int intValue()
      Returns the int value of this PositiveInteger.
      Returns:
      the int value of this PositiveInteger
    • toString

      public String toString()
      Returns the String representation of this PositiveInteger. The String representation is an integer between 1 and 2147483647 (inclusive).
      Overrides:
      toString in class Object
      Returns:
      the String representation of this PositiveInteger