Class PositiveInteger
java.lang.Object
java.lang.Number
de.espirit.firstspirit.common.number.AbstractNumberType<PositiveInteger>
de.espirit.firstspirit.common.number.PositiveInteger
- All Implemented Interfaces:
ValueOfContractor
,Serializable
,Comparable<PositiveInteger>
Integer type replacement for positive numbers.
- Since:
- 2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.common.text.ValueOfContractor
ValueOfContractor.Invoke
-
Method Summary
Modifier and TypeMethodDescriptionint
static @NotNull PositiveInteger
valueOf
(int number) Create an instance from an Integerstatic @Nullable PositiveInteger
Create an instance from a Numberstatic @Nullable PositiveInteger
Create an instance from a String.Methods inherited from class de.espirit.firstspirit.common.number.AbstractNumberType
doubleValue, equals, floatValue, hashCode, intValue, longValue, toString
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PositiveInteger>
- Specified by:
compareTo
in classAbstractNumberType<PositiveInteger>
-
valueOf
@Contract("null -> null; !null -> !null") @Nullable public static @Nullable PositiveInteger valueOf(@Nullable @Nullable String string) Create an instance from a String.Fulfills the
ValueOfContractor
marker.- Parameters:
string
- The string to create from.- Returns:
- The created instance or
null
, iff the given string is null. - Throws:
de.espirit.common.util.IllegalValueArgumentException
- If the given string is not appropriate for a positive integer.- Since:
- 4.0
-
valueOf
@Contract("null -> null; !null -> !null") @Nullable public static @Nullable PositiveInteger valueOf(@Nullable @Nullable Number number) Create an instance from a Number- Parameters:
number
- The number to create from- Returns:
- The created instance or
null
, iff the given number is null - Since:
- 4.0
-
valueOf
Create an instance from an Integer- Parameters:
number
- The number to create from- Returns:
- The created instance, never
null
- Since:
- 4.0
-