public class NumberUtils extends Object
| Constructor and Description |
|---|
NumberUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
toInt(String str,
int defaultValue)
Convert a
String to an int, returning a
default value if the conversion fails. |
static Long |
toLong(String str) |
static Long |
toLong(String str,
Long defaultValue) |
public static int toInt(String str, int defaultValue)
Convert a String to an int, returning a
default value if the conversion fails.
If the string is null, the default value is returned.
str - the string to convert, may be nulldefaultValue - the default valueCopyright © 2023 Seata. All rights reserved.