Package com.clover.sdk.v3.cash
Class CashEvent
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.cash.CashEvent
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class CashEvent extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CashEvent.Constraints
-
Nested classes/interfaces inherited from interface com.clover.sdk.JSONifiable
JSONifiable.Creator<T>
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<CashEvent>
CREATOR
static JSONifiable.Creator<CashEvent>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description CashEvent()
Constructs a new empty instance.protected
CashEvent(boolean noInit)
Constructs a new empty instance.CashEvent(CashEvent src)
Constructs a new instance that is a deep copy of the source instance.CashEvent(String json)
Constructs a new instance from the given JSON String.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAmountChange()
Clears the 'amountChange' field, the 'has' method for this field will now return falsevoid
clearDevice()
Clears the 'device' field, the 'has' method for this field will now return falsevoid
clearEmployee()
Clears the 'employee' field, the 'has' method for this field will now return falsevoid
clearMerchant()
Clears the 'merchant' field, the 'has' method for this field will now return falsevoid
clearNote()
Clears the 'note' field, the 'has' method for this field will now return falsevoid
clearTimestamp()
Clears the 'timestamp' field, the 'has' method for this field will now return falsevoid
clearType()
Clears the 'type' field, the 'has' method for this field will now return falseboolean
containsChanges()
Returns true if this instance has any changes.CashEvent
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.Long
getAmountChange()
The amount that was either added, removed of modified by the eventDevice
getDevice()
The device that initiated the eventEmployee
getEmployee()
The employee who performed the eventprotected GenericClient
getGenericClient()
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.Reference
getMerchant()
The event occurred for this merchant.String
getNote()
Any additional information regarding the eventLong
getTimestamp()
Time at which the event was executedType
getType()
The type of event that occurredboolean
hasAmountChange()
Checks whether the 'amountChange' field has been set, however the value could be nullboolean
hasDevice()
Checks whether the 'device' field has been set, however the value could be nullboolean
hasEmployee()
Checks whether the 'employee' field has been set, however the value could be nullboolean
hasMerchant()
Checks whether the 'merchant' field has been set, however the value could be nullboolean
hasNote()
Checks whether the 'note' field has been set, however the value could be nullboolean
hasTimestamp()
Checks whether the 'timestamp' field has been set, however the value could be nullboolean
hasType()
Checks whether the 'type' field has been set, however the value could be nullboolean
isNotNullAmountChange()
Checks whether the 'amountChange' field is set and is not nullboolean
isNotNullDevice()
Checks whether the 'device' field is set and is not nullboolean
isNotNullEmployee()
Checks whether the 'employee' field is set and is not nullboolean
isNotNullMerchant()
Checks whether the 'merchant' field is set and is not nullboolean
isNotNullNote()
Checks whether the 'note' field is set and is not nullboolean
isNotNullTimestamp()
Checks whether the 'timestamp' field is set and is not nullboolean
isNotNullType()
Checks whether the 'type' field is set and is not nullvoid
mergeChanges(CashEvent src)
Copy all the changed fields from the given source to this instance.void
resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.CashEvent
setAmountChange(Long amountChange)
Sets the field 'amountChange'.CashEvent
setDevice(Device device)
Sets the field 'device'.CashEvent
setEmployee(Employee employee)
Sets the field 'employee'.CashEvent
setMerchant(Reference merchant)
Sets the field 'merchant'.CashEvent
setNote(String note)
Sets the field 'note'.CashEvent
setTimestamp(Long timestamp)
Sets the field 'timestamp'.CashEvent
setType(Type type)
Sets the field 'type'.void
validate()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<CashEvent> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<CashEvent> JSON_CREATOR
-
-
Constructor Detail
-
CashEvent
public CashEvent()
Constructs a new empty instance.
-
CashEvent
protected CashEvent(boolean noInit)
Constructs a new empty instance.
-
CashEvent
public CashEvent(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
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.
-
getGenericClient
protected GenericClient getGenericClient()
- Specified by:
getGenericClient
in classGenericParcelable
-
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 interfaceJSONifiable
-
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
-
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.
-
-