Class CashEvent

    • Constructor Detail

      • CashEvent

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

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

        public CashEvent​(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.
      • CashEvent

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

      • getType

        public Type getType()
        The type of event that occurred
      • getAmountChange

        public Long getAmountChange()
        The amount that was either added, removed of modified by the event
      • getTimestamp

        public Long getTimestamp()
        Time at which the event was executed
      • getNote

        public String getNote()
        Any additional information regarding the event
      • getEmployee

        public Employee getEmployee()
        The employee who performed the event
      • getDevice

        public Device getDevice()
        The device that initiated the event
      • getMerchant

        public Reference getMerchant()
        The event occurred for this merchant.
      • 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
      • isNotNullType

        public boolean isNotNullType()
        Checks whether the 'type' field is set and is not null
      • isNotNullAmountChange

        public boolean isNotNullAmountChange()
        Checks whether the 'amountChange' field is set and is not null
      • isNotNullTimestamp

        public boolean isNotNullTimestamp()
        Checks whether the 'timestamp' field is set and is not null
      • isNotNullNote

        public boolean isNotNullNote()
        Checks whether the 'note' field is set and is not null
      • isNotNullEmployee

        public boolean isNotNullEmployee()
        Checks whether the 'employee' field is set and is not null
      • isNotNullDevice

        public boolean isNotNullDevice()
        Checks whether the 'device' field is set and is not null
      • isNotNullMerchant

        public boolean isNotNullMerchant()
        Checks whether the 'merchant' field is set and is not null
      • hasType

        public boolean hasType()
        Checks whether the 'type' field has been set, however the value could be null
      • hasAmountChange

        public boolean hasAmountChange()
        Checks whether the 'amountChange' field has been set, however the value could be null
      • hasTimestamp

        public boolean hasTimestamp()
        Checks whether the 'timestamp' field has been set, however the value could be null
      • hasNote

        public boolean hasNote()
        Checks whether the 'note' field has been set, however the value could be null
      • hasEmployee

        public boolean hasEmployee()
        Checks whether the 'employee' field has been set, however the value could be null
      • hasDevice

        public boolean hasDevice()
        Checks whether the 'device' field has been set, however the value could be null
      • hasMerchant

        public boolean hasMerchant()
        Checks whether the 'merchant' field has been set, however the value could be null
      • setType

        public CashEvent setType​(Type type)
        Sets the field 'type'.
      • setAmountChange

        public CashEvent setAmountChange​(Long amountChange)
        Sets the field 'amountChange'.
      • setTimestamp

        public CashEvent setTimestamp​(Long timestamp)
        Sets the field 'timestamp'.
      • setNote

        public CashEvent setNote​(String note)
        Sets the field 'note'.
      • setEmployee

        public CashEvent setEmployee​(Employee employee)
        Sets the field 'employee'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setDevice

        public CashEvent setDevice​(Device device)
        Sets the field 'device'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setMerchant

        public CashEvent setMerchant​(Reference merchant)
        Sets the field 'merchant'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • clearType

        public void clearType()
        Clears the 'type' field, the 'has' method for this field will now return false
      • clearAmountChange

        public void clearAmountChange()
        Clears the 'amountChange' field, the 'has' method for this field will now return false
      • clearTimestamp

        public void clearTimestamp()
        Clears the 'timestamp' field, the 'has' method for this field will now return false
      • clearNote

        public void clearNote()
        Clears the 'note' field, the 'has' method for this field will now return false
      • clearEmployee

        public void clearEmployee()
        Clears the 'employee' field, the 'has' method for this field will now return false
      • clearDevice

        public void clearDevice()
        Clears the 'device' field, the 'has' method for this field will now return false
      • clearMerchant

        public void clearMerchant()
        Clears the 'merchant' 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 CashEvent copyChanges()
        Create a copy of this instance that contains only fields that were set after the constructor was called.
      • mergeChanges

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