public static byte getObjectType(Object type) {
        if (type instanceof Integer) {
            return TYPE_INTEGER;
        } else if (type instanceof Float) {
            return TYPE_FLOAT;
        } else if (type instanceof Boolean) {
            return TYPE_BOOLEAN;
        } else if (type instanceof String) {
            return TYPE_STRING;
        } else if (type instanceof Long) {
            return TYPE_LONG;
        } else if (type instanceof Savable) {
            return TYPE_SAVABLE;
        } else if (type instanceof List) {
            return TYPE_LIST;
        } else if (type instanceof Map) {
            return TYPE_MAP;
        } else if (type instanceof Object[]) {
            return TYPE_ARRAY;
        } else if (type instanceof Double) {
            return TYPE_DOUBLE;
        } else if (type instanceof Short) {
            return TYPE_SHORT;
        } else if (type instanceof Byte) {
            return TYPE_BYTE;
        } else {
            throw new IllegalArgumentException("Unsupported type: " + type.getClass().getName());
        }
    }
Creates a new <code>UserData</code> with the given
type and value.

@param type
           Type of data, should be between 0 and 8.
@param value
           Value of the data
jme3-core/src/main/java/com/jme3/scene/UserData.java