Package io.micronaut.openapi.visitor
Class NumberUtils
- java.lang.Object
-
- io.micronaut.openapi.visitor.NumberUtils
-
public class NumberUtils extends java.lang.ObjectNumber utils.
-
-
Constructor Summary
Constructors Constructor Description NumberUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisCreatable(java.lang.String str)Checks whether the String a valid Java number.
-
-
-
Method Detail
-
isCreatable
public static boolean isCreatable(java.lang.String str)
Checks whether the String a valid Java number.
Valid numbers include hexadecimal marked with the
0xor0Xqualifier, octal numbers, scientific notation and numbers marked with a type qualifier (e.g. 123L).Non-hexadecimal strings beginning with a leading zero are treated as octal values. Thus the string
09will returnfalse, since9is not a valid octal value. However, numbers beginning with0.are treated as decimal.nulland empty/blankStringwill returnfalse.Note, createNumber(String) should return a number for every input resulting in
true.- Parameters:
str- theStringto check- Returns:
trueif the string is a correctly formatted number- Since:
- 3.5
-
-