Java Utililty Methods Object Convert to

List of utility methods to do Object Convert to

Description

The list of methods to do Object Convert to are organized into topic(s).

Method

booleanobjToBoolean(Object o)
obj To Boolean
if (o != null) {
    if (o instanceof Boolean)
        return ((Boolean) o).booleanValue();
    else if (o instanceof String) {
        String s = (String) o;
        if (s.equalsIgnoreCase("true"))
            return true;
        if (s.equalsIgnoreCase("false"))
...
LongobjToLong(Object obj)
obj To Long
return null == obj || "null".equals(obj.toString()) ? 0 : Long.parseLong(obj.toString());
String[]objToPrim()
obj To Prim
String[] methods = new String[types.length];
for (int i = 0; i < methods.length; i++) {
    String prim = types[i][0];
    String obj = types[i][1];
    insertDoc(methods, i, "Converts a {@link %o} array to its primitive equivalent (%p[])");
    methods[i] += "public static " + prim + "[] objToPrim(" + obj + "[] array) {\n";
    methods[i] += "   " + prim + "[] clone = new " + prim + "[array.length];\n";
    methods[i] += "\n   for(int i = 0; i < array.length; i++)\n";
...
LongobjToTimeLong(Object obj)
obj To Time Long
Long l = null;
if (obj != null) {
    l = (Long) obj;
return l;