Class AppNotification

    • Constructor Detail

      • AppNotification

        public AppNotification()
        Constructs a new empty instance.
      • AppNotification

        protected AppNotification​(boolean noInit)
        Constructs a new empty instance.
      • AppNotification

        public AppNotification​(JSONObject jsonObject)
        Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • AppNotification

        public AppNotification​(AppNotification src)
        Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
    • Method Detail

      • getApp

        public Reference getApp()
        The app the notification will be sent to. This will be autopopulated by the server.
      • getEvent

        public String getEvent()
      • getTimeToLive

        public Long getTimeToLive()
        The time to live of the notification in seconds. By default this is 5 days.
      • getData

        public String getData()
        Payload of the notification. This is at most 4000 characters.
      • getJSONObject

        public JSONObject getJSONObject()
        Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be reflected in this instance and vice-versa.
        Specified by:
        getJSONObject in interface JSONifiable
      • isNotNullApp

        public boolean isNotNullApp()
        Checks whether the 'app' field is set and is not null
      • isNotNullEvent

        public boolean isNotNullEvent()
        Checks whether the 'event' field is set and is not null
      • isNotNullTimeToLive

        public boolean isNotNullTimeToLive()
        Checks whether the 'timeToLive' field is set and is not null
      • isNotNullData

        public boolean isNotNullData()
        Checks whether the 'data' field is set and is not null
      • hasApp

        public boolean hasApp()
        Checks whether the 'app' field has been set, however the value could be null
      • hasEvent

        public boolean hasEvent()
        Checks whether the 'event' field has been set, however the value could be null
      • hasTimeToLive

        public boolean hasTimeToLive()
        Checks whether the 'timeToLive' field has been set, however the value could be null
      • hasData

        public boolean hasData()
        Checks whether the 'data' field has been set, however the value could be null
      • setApp

        public AppNotification setApp​(Reference app)
        Sets the field 'app'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setTimeToLive

        public AppNotification setTimeToLive​(Long timeToLive)
        Sets the field 'timeToLive'.
      • clearApp

        public void clearApp()
        Clears the 'app' field, the 'has' method for this field will now return false
      • clearEvent

        public void clearEvent()
        Clears the 'event' field, the 'has' method for this field will now return false
      • clearTimeToLive

        public void clearTimeToLive()
        Clears the 'timeToLive' field, the 'has' method for this field will now return false
      • clearData

        public void clearData()
        Clears the 'data' field, the 'has' method for this field will now return false
      • containsChanges

        public boolean containsChanges()
        Returns true if this instance has any changes.
      • resetChangeLog

        public void resetChangeLog()
        Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
      • copyChanges

        public AppNotification copyChanges()
        Create a copy of this instance that contains only fields that were set after the constructor was called.
      • mergeChanges

        public void mergeChanges​(AppNotification src)
        Copy all the changed fields from the given source to this instance.