<p>transform.</p>

@param obj a {@link java.lang.Object} object.
@return a {@link java.lang.Object} object.
495823
@SuppressWarnings("unchecked")
    public Object transform(final Object obj) {
        if (obj != null && !(obj instanceof BeanMap)) {
            Class clazz = obj.getClass();
            if (clazz.isArray()) {
                return _transform((Object[]) obj);
            } else if (obj instanceof Map) {
                return _transform((Map) obj);
            } else if (obj instanceof List) {
                return _transform((List) obj);
            } else if (obj instanceof Set) {
                return _transform((Set) obj);
            } else if (obj instanceof Collection) {
                return _transform((Collection) obj);
            } else if (obj instanceof Iterable) {
                return _transform((Iterable) obj);
            } else if (obj instanceof Iterator) {
                return _transform((Iterator) obj);
            } else if (needTransform(obj)) {
                return onTransform(obj);
            }
        }
        return obj;
    }
490516
public Entity toEntity(Object obj) {
        try {
            return toEntity(obj, null, null, null);
        } catch (Siren4JException e) {
            throw new Siren4JConversionException(e);
        }
    }
622773
public static Class<?> getClass(Object obj) {
		Class<?> cls = obj.getClass();
		return cls != Class.class ? cls : (Class<?>) obj;
	}
416732
public JsonModelCoder<T> doResolve(T obj) {
		JsonModelCoder<T> coder = resolve(obj);
		if (coder == null) {
			throw new NullPointerException("resolve method must return coder.");
		}
		return coder;
	}
33501
public static Object getProperty(Object obj, String name) {
		if (obj == null)
			throw new NullPointerException("Object cannot be null");
		if (name == null)
			throw new NullPointerException("Property name cannot be null");

		Class<?> objClass = obj.getClass();

		// Search in fields
		for (Field field : objClass.getFields()) {
			try {
				if (matchField(field, name))
					return field.get(obj);
			} catch (Throwable t) {
				// Ignore exceptions
			}
		}

		// Search in properties
		name = "get" + name;
		for (Method method : objClass.getMethods()) {
			try {
				if (matchPropertyGetter(method, name))
					return method.invoke(obj);
			} catch (Throwable t) {
				// Ignore exceptions
			}
		}

		return null;
	}
671020
@SuppressWarnings("unchecked")
        public static <T> ClassSup<T> cls(T obj) {
                return mapper.get(obj.getClass().getName(), () -> (ClassSup<T>) cls(obj.getClass()));
        }
109755
public static String toJson(Object obj) {
        StringWriter sw = new StringWriter();
        ObjectMapper mapper = getDefaultObjectMapper();
        try {
            JsonGenerator jg = mapper.getFactory().createGenerator(sw);
            mapper.writeValue(jg, obj);
        } catch (JsonMappingException e) {
            e.printStackTrace();
        } catch (JsonGenerationException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return sw.toString();
    }
1210703
@NonNull
    public static <T> T nonNull(@Nullable T obj) {
        if (obj == null) {
           throw new IllegalArgumentException("encountered illegal null value");
        }
        return obj;
    }
1000131
@GwtIncompatible("incompatible method")
    public ToStringBuilder append(final Object obj) {
        style.append(buffer, null, obj, null);
        return this;
    }
428742
@SuppressWarnings("unchecked")
	public static <T> T as(Class<T> t, final Object obj) {
		return (T) Proxy.newProxyInstance(t.getClassLoader(), new Class[] { t }, new InvocationHandler() {
			public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
				try {
					return obj.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(obj, args);
				} catch (NoSuchMethodException nsme) {
					throw new NoSuchMethodError(nsme.getMessage());
				} catch (InvocationTargetException ite) {
					throw ite.getTargetException();
				}
			}
		});
	}
56706
@SuppressWarnings("unchecked")
	private Map<String, Object> o(Object obj) {
		return (Map<String, Object>) obj;
	}
1319566
public static MOAObject copy(MOAObject obj) {
        try {
            return (MOAObject) SerializeUtils.copyObject(obj);
        } catch (Exception e) {
            throw new RuntimeException("Object copy failed.", e);
        }
    }
987600
public static String serialize(final Object obj) throws IOException {
		final ObjectMapper mapper = new ObjectMapper();
        mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
		return mapper.writeValueAsString(obj);
		
	}
1107299
public static String serialize(Object obj) throws SerializationException {
		try {
			if (obj != null) {
				return mapper.writeValueAsString(obj);
			} else {
				return null;
			}
		} catch (Exception e) {
			logger.error("SerializationException {}", e.getMessage());
			throw new SerializationException(e.getMessage());
		}
	}
50720
public static Serializable copy(Serializable obj) {
        try {
            ByteArrayOutputStream buf = new ByteArrayOutputStream(4096);
            ObjectOutputStream out = new ObjectOutputStream(buf);
            out.writeObject(obj);
            out.close();

            ByteArrayInputStream buf2 = new ByteArrayInputStream(buf.toByteArray());
            ObjectInputStream in = new ObjectInputStream(buf2);
            Serializable            obj2 = (Serializable) in.readObject();
            in.close();

            return obj2;
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
563238
public GraphObject getGraphObject(Object obj)
	{
		String key = getKey(obj);
		GraphObject go = objectMap.get(key);

//		if (obj instanceof Conversion && go == null)
//		{
//			go = objectMap.get(key + ConversionWrapper.LEFT_TO_RIGHT);
//			if (go == null)
//				go = objectMap.get(key + ConversionWrapper.RIGHT_TO_LEFT);
//		}

		if (go == null)
		{
			Node node = wrap(obj);

			if (node != null)
			{
				objectMap.put(key, node);
				node.init();
			}
		}

		return objectMap.get(key);
	}
276598
public static Object[] toArray(Object obj)
	{
		if (obj instanceof Object[])
			return (Object[]) obj;
		else
		{
			Object[] returnArray =
			{ obj };
			return returnArray;

		}
	}