Class PositiveInteger
java.lang.Object
com.github.jh3nd3rs0n.jargyle.common.number.PositiveInteger
An integer between 1 and 2147483647 (inclusive).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximumintvalue of a positive integer.static final intThe minimumintvalue of a positive integer. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()intintValue()Returns theintvalue of thisPositiveInteger.toString()Returns theStringrepresentation of thisPositiveInteger.static PositiveIntegervalueOf(int i) Returns aPositiveIntegerof the providedintvalue.static PositiveIntegerReturns aPositiveIntegerof the providedString.
-
Field Details
-
MAX_INT_VALUE
public static final int MAX_INT_VALUEThe maximumintvalue of a positive integer.- See Also:
-
MIN_INT_VALUE
public static final int MIN_INT_VALUEThe minimumintvalue of a positive integer.- See Also:
-
-
Method Details
-
valueOf
Returns aPositiveIntegerof the providedintvalue. AnIllegalArgumentExceptionis thrown if the providedintvalue is less than 1.- Parameters:
i- the providedintvalue- Returns:
- a
PositiveIntegerof the providedintvalue
-
valueOf
Returns aPositiveIntegerof the providedString. AnIllegalArgumentExceptionis thrown if the providedStringis not an integer between 1 and 2147483647 (inclusive).- Parameters:
s- the providedString- Returns:
- a
PositiveIntegerof the providedString
-
equals
-
hashCode
public int hashCode() -
intValue
public int intValue()Returns theintvalue of thisPositiveInteger.- Returns:
- the
intvalue of thisPositiveInteger
-
toString
Returns theStringrepresentation of thisPositiveInteger. TheStringrepresentation is an integer between 1 and 2147483647 (inclusive).
-