Numbers
org.beangle.commons.lang.Numbers
object Numbers
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Numbers.type
Members list
Value members
Concrete methods
Checks whether the String
contains only digit characters.
Checks whether the String
contains only digit characters.
Null
and empty String will return false
.
Value parameters
- str
-
the
String
to check
Attributes
- Returns
-
true
if str contains only Unicode numeric
Convert a String
to an int
, returning a default value if the conversion fails.
Convert a String
to an int
, returning a default value if the conversion fails.
If the string is null
, the default value is returned.
toInt(null, 1) = 1 toInt("", 1) = 1 toInt("1", 0) = 1
Value parameters
- defaultValue
-
the default value
- str
-
the string to convert, may be null
Attributes
- Returns
-
the int represented by the string, or the default if conversion fails
- Since
-
3.0
transform to int.
transform to int.
Value parameters
- ids
-
an array of String objects.
Attributes
- Returns
-
an array of int objects.
transformToLong.
transformToLong.
Value parameters
- ids
-
an array of String objects.
Attributes
- Returns
-
an array of Long objects.
In this article