Class PositiveInteger
java.lang.Object
com.github.jh3nd3rs0n.jargyle.common.number.PositiveInteger
An integer between 1 and 2147483647 (inclusive).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximumint
value of a positive integer.static final int
The minimumint
value of a positive integer. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
int
intValue()
Returns theint
value of thisPositiveInteger
.toString()
Returns theString
representation of thisPositiveInteger
.static PositiveInteger
valueOf
(int i) Returns aPositiveInteger
of the providedint
value.static PositiveInteger
Returns aPositiveInteger
of the providedString
.
-
Field Details
-
MAX_INT_VALUE
public static final int MAX_INT_VALUEThe maximumint
value of a positive integer.- See Also:
-
MIN_INT_VALUE
public static final int MIN_INT_VALUEThe minimumint
value of a positive integer.- See Also:
-
-
Method Details
-
valueOf
Returns aPositiveInteger
of the providedint
value. AnIllegalArgumentException
is thrown if the providedint
value is less than 1.- Parameters:
i
- the providedint
value- Returns:
- a
PositiveInteger
of the providedint
value
-
valueOf
Returns aPositiveInteger
of the providedString
. AnIllegalArgumentException
is thrown if the providedString
is not an integer between 1 and 2147483647 (inclusive).- Parameters:
s
- the providedString
- Returns:
- a
PositiveInteger
of the providedString
-
equals
-
hashCode
public int hashCode() -
intValue
public int intValue()Returns theint
value of thisPositiveInteger
.- Returns:
- the
int
value of thisPositiveInteger
-
toString
Returns theString
representation of thisPositiveInteger
. TheString
representation is an integer between 1 and 2147483647 (inclusive).
-