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 TypeMethodDescriptionintstatic @NotNull PositiveIntegervalueOf(int number) Create an instance from an Integerstatic @Nullable PositiveIntegerCreate an instance from a Numberstatic @Nullable PositiveIntegerCreate an instance from a String.Methods inherited from class de.espirit.firstspirit.common.number.AbstractNumberType
doubleValue, equals, floatValue, hashCode, intValue, longValue, toStringMethods inherited from class java.lang.Number
byteValue, shortValue
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<PositiveInteger>- Specified by:
compareToin 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
ValueOfContractormarker.- 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
-