public class CastHelper extends Object
| 构造器和说明 |
|---|
CastHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
castBoolean(Object obj)
转为 boolean 型
|
static boolean |
castBoolean(Object obj,
boolean defaultValue)
转为 boolean 型(提供默认值)
|
static double |
castDouble(Object obj)
转为 double 型
|
static double |
castDouble(Object obj,
double defaultValue)
转为 double 型(提供默认值)
|
static int |
castInt(Object obj)
转为 int 型
|
static int |
castInt(Object obj,
int defaultValue)
转为 int 型(提供默认值)
|
static long |
castLong(Object obj)
转为 long 型
|
static long |
castLong(Object obj,
long defaultValue)
转为 long 型(提供默认值)
|
static String |
castString(Object obj)
转为 String 型
|
static String |
castString(Object obj,
String defaultValue)
转为 String 型(提供默认值)
|
public static String castString(Object obj, String defaultValue)
obj - the objdefaultValue - the default valuepublic static double castDouble(Object obj)
obj - the objpublic static double castDouble(Object obj, double defaultValue)
obj - the objdefaultValue - the default valuepublic static long castLong(Object obj)
obj - the objpublic static long castLong(Object obj, long defaultValue)
obj - the objdefaultValue - the default valuepublic static int castInt(Object obj)
obj - the objpublic static int castInt(Object obj, int defaultValue)
obj - the objdefaultValue - the default valuepublic static boolean castBoolean(Object obj)
obj - the objpublic static boolean castBoolean(Object obj, boolean defaultValue)
obj - the objdefaultValue - the default valueCopyright © 2017. All rights reserved.