public class StringCastUtil extends Object
| Constructor and Description |
|---|
StringCastUtil() |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull BigDecimal |
asDecimal(String str,
@NotNull BigDecimal elz)
转换成BigDecimal
|
static double |
asDouble(@Nullable String str,
double elz)
转换成double
|
static boolean |
asFalse(@Nullable String str)
null, empty, blank, false,f,no,n不区分大小写,认为是false
注意,和asTrue不是存在传递关系
|
static float |
asFloat(@Nullable String str,
float elz)
转换成float
|
static int |
asInt(@Nullable String str,
int elz)
转换成long
|
static long |
asLong(@Nullable String str,
long elz)
转换成long
|
static boolean |
asTrue(@Nullable String str)
true,t,yes,y,不区分大小写,认为是true
注意,和asFalse不是存在传递关系
|
static @NotNull String |
string(BigDecimal v) |
static @NotNull String |
string(Character v) |
static @NotNull String |
string(Double v) |
static @NotNull String |
string(Float v) |
static @NotNull String |
string(Integer v) |
static @NotNull String |
string(Long v) |
public static boolean asTrue(@Nullable
@Nullable String str)
str - 字符串public static boolean asFalse(@Nullable
@Nullable String str)
str - 字符串public static long asLong(@Nullable
@Nullable String str,
long elz)
str - 字符串elz - 默认值public static int asInt(@Nullable
@Nullable String str,
int elz)
str - 字符串elz - 默认值public static float asFloat(@Nullable
@Nullable String str,
float elz)
str - 字符串elz - 默认值public static double asDouble(@Nullable
@Nullable String str,
double elz)
str - 字符串elz - 默认值@NotNull public static @NotNull BigDecimal asDecimal(String str, @NotNull @NotNull BigDecimal elz)
str - 字符串elz - 默认值@NotNull public static @NotNull String string(BigDecimal v)
Copyright © 2020. All rights reserved.