List of utility methods to do Is Serializable Object
boolean | isSerializable(Object obj) Verify that an object is Serializable by attempting to serialize it. return isSerializable(obj, false);
|
boolean | isSerializable(Object object) is Serializable if (object instanceof Map.Entry) return isSerializable(((Map.Entry) object).getKey()) && isSerializable(((Map.Entry) object).getValue()); if (object == null) return true; if (object instanceof String) return true; if (object instanceof Number) return true; ... |
boolean | isSerializableType(Class> type) Checks if is serializable type. if (Void.class.isAssignableFrom(type)) { return true; if (Object.class.isAssignableFrom(type) && !Serializable.class.isAssignableFrom(type)) { return false; return true; |