code: public static long toLongValue(Object o, long defaultValue) {
  	if (o instanceof Character) return (((Character) o).charValue());
  	else if (o instanceof Boolean) return ((((Boolean) o).booleanValue()) ? 1L : 0L);
  	else if (o instanceof Number) return (((Number) o).longValue());
  	else if (o instanceof CharSequence) return (long) toDoubleValue(o.toString(), defaultValue);
  	else if (o instanceof Castable) {
  	    return (long) ((Castable) o).castToDoubleValue(defaultValue);
  	}
  	else if (o instanceof Character) return (long) (((Character) o).charValue());
  	else if (o instanceof ObjectWrap) return toLongValue(((ObjectWrap) o).getEmbededObject(toLong(defaultValue)), defaultValue);
  
  	return defaultValue;
      }
docs: cast a Object to a long value (primitive value type)
  
  @param o Object to cast
  @param defaultValue
  @return casted long value