Package 

Class SimpleModelStore

  • All Implemented Interfaces:
    com.onesignal.common.events.IEventNotifier , com.onesignal.common.modeling.IModelChangedHandler , com.onesignal.common.modeling.IModelStore

    
    public class SimpleModelStore<TModel extends Model>
    extends ModelStore<TModel>
                        

    A simple model store is a concrete implementation of the ModelStore which provides a basic implementation of the create method. Specifically, it will instantiate a new instance of the TModel via the lambda _create passed in during initialization.

    • Method Summary

      Modifier and Type Method Description
      Boolean getHasSubscribers()
      final String getName() The persistable name of the model store.
      TModel create(JSONObject jsonObject) Create a new instance of the model and add it to the store.
      • Methods inherited from class com.onesignal.common.modeling.SimpleModelStore

        add, add, clear, get, list, onChanged, persist, remove, replaceAll, subscribe, unsubscribe
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getName

         final String getName()

        The persistable name of the model store. If not specified no persisting will occur.

      • create

         TModel create(JSONObject jsonObject)

        Create a new instance of the model and add it to the store. The new instance is not added to the model store, because it may not yet have an Model.id which is required.

        Parameters:
        jsonObject - The optional JSONObject to initialize the new model with.