Package 

Class Model

  • All Implemented Interfaces:
    com.onesignal.common.events.IEventNotifier

    
    public class Model
     implements IEventNotifier<IModelChangedHandler>
                        

    The base class for a Model. A model is effectively a map of data, each key in the map being a property of the model, each value in the map being the property value. A property can be one of the following values:

    Simple Types

    ------------

    Boolean String Int/Long/Double/Float

    When a Model is nested (a property is a Model type or List of Model types) the child Model is owned and initialized by the parent Model.

    When a structured schema should be enforced this class should be extended, the base class utilizing Properties with getters/setters that wrap getProperty and setProperty calls to the underlying data.

    When a more dynamic schema is needed, the MapModel class can be used, which bridges a MutableMap and Model.

    Deserialization

    ---------------

    When deserializing a flat Model nothing specific is required. However if the Model is nested the createModelForProperty and/or createListForProperty needs to be implemented to aide in the deserialization process.