public synchronized void save ( ) { SharedPreferences prefs = loadSharedPreferences ( "object" ) ; if ( find ( getId ( ) ) == null ) { addObject ( ) ; modelListenerHandler . execOnUpdateListeners ( this , OnUpdateListener . Status . CREATED ) ; if ( cache && cachedObjects != null ) { cachedObjects . add ( ( T ) this ) ; } } else { modelListenerHandler . execOnUpdateListeners ( this , OnUpdateListener . Status . UPDATED ) ; } prefs . edit ( ) . putString ( String . valueOf ( getId ( ) ) , toJson ( ) . toString ( ) ) . commit ( ) ; }
Saves the current object .