public static boolean objectIsMutable ( Object object ) { if ( object == null ) { return false ; } Class < ? > clazz = object . getClass ( ) ; return Collection . class . isAssignableFrom ( clazz ) ; }
Returns true if the given object is a mutable type that needs to be enhanced as DirtyableDBObject to prevent lost changes . Array types are ok because the default isDirty method will detect changes there .