@Override public T copy(T value) { if (value != null) { return classMetadata.copy(value); } return null; } }
@Override public <TYPE extends T> TYPE copy(TYPE object) { ClassMetadata<TYPE, ?> info = getMetadata(object); if (info != null) { return info.copy(object); } return null; }
/** * This method is for use in situations where metadata is being used generically and the actual type of the value cannot be * * @param object The instance of this class to copy * @return A copy of the given object, or null if object is not of the type described by this metadata. */ public T copyRaw(Object object) { if (getType().isInstance(object)) { return copy(getType().cast(object)); } return null; }