Package org.onemind.commons.java.util
Class ObjectUtils
- java.lang.Object
-
- org.onemind.commons.java.util.ObjectUtils
-
public final class ObjectUtils extends java.lang.Object
Property utilities- Version:
- $Id: ObjectUtils.java,v 1.2 2004/08/26 12:33:17 thlee Exp $ $Name: $
- Author:
- TiongHiang Lee (thlee@onemindsoft.org)
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ObjectUtils()
Constructor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
toBool(java.lang.Object value, boolean def)
Convert the object the boolean, return the default if it cannot be convertedstatic double
toDouble(java.lang.Object value, double def)
Convert the object to double, or return the default if it cannot be convertedstatic float
toFloat(java.lang.Object value, float def)
Convert the object to float, or return the default if it cannot be convertedstatic int
toInt(java.lang.Object value, int def)
Convert the object to int, or return the default if it cannot be convertedstatic long
toLong(java.lang.Object value, long def)
Convert the object to long, or return the default if it cannot be converted
-
-
-
Method Detail
-
toBool
public static final boolean toBool(java.lang.Object value, boolean def)
Convert the object the boolean, return the default if it cannot be converted- Parameters:
value
- the valuedef
- the default- Returns:
- the converted value, or def if value is null
-
toInt
public static int toInt(java.lang.Object value, int def)
Convert the object to int, or return the default if it cannot be converted- Parameters:
value
- the valuedef
- the default- Returns:
- the converted int, or default if it cannot be converted
-
toLong
public static long toLong(java.lang.Object value, long def)
Convert the object to long, or return the default if it cannot be converted- Parameters:
value
- the valuedef
- the default- Returns:
- the converted int, or default if it cannot be converted
-
toFloat
public static float toFloat(java.lang.Object value, float def)
Convert the object to float, or return the default if it cannot be converted- Parameters:
value
- the valuedef
- the default- Returns:
- the converted int, or default if it cannot be converted
-
toDouble
public static double toDouble(java.lang.Object value, double def)
Convert the object to double, or return the default if it cannot be converted- Parameters:
value
- the valuedef
- the default- Returns:
- the converted int, or default if it cannot be converted
-
-