Class NumberUtil
- java.lang.Object
-
- com.atlassian.confluence.impl.util.NumberUtil
-
public final class NumberUtil extends Object
Number-related utility methods.- Since:
- 6.7.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NonNull Optional<Integer>
parseInteger(@Nullable String string)
Parses the given string into an Integer.
-
-
-
Method Detail
-
parseInteger
public static @NonNull Optional<Integer> parseInteger(@Nullable String string)
Parses the given string into an Integer. Returns anOptional
rather than anOptionalInt
, because they are easier to compose with other Optionals.- Parameters:
string
- the string to parse- Returns:
- an empty if the string is non-numeric, e.g. blank or alphanumeric
- See Also:
NumberFormatException
-
-