public class CashEvent extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
CashEvent.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<CashEvent> |
CREATOR |
static JSONifiable.Creator<CashEvent> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and 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(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(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAmountChange()
Clears the 'amountChange' field, the 'has' method for this field will now return false
|
void |
clearDevice()
Clears the 'device' field, the 'has' method for this field will now return false
|
void |
clearEmployee()
Clears the 'employee' field, the 'has' method for this field will now return false
|
void |
clearMerchant()
Clears the 'merchant' field, the 'has' method for this field will now return false
|
void |
clearNote()
Clears the 'note' field, the 'has' method for this field will now return false
|
void |
clearTimestamp()
Clears the 'timestamp' field, the 'has' method for this field will now return false
|
void |
clearType()
Clears the 'type' field, the 'has' method for this field will now return false
|
boolean |
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 event
|
Device |
getDevice()
The device that initiated the event
|
Employee |
getEmployee()
The employee who performed the event
|
protected 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 event
|
Long |
getTimestamp()
Time at which the event was executed
|
Type |
getType()
The type of event that occurred
|
boolean |
hasAmountChange()
Checks whether the 'amountChange' field has been set, however the value could be null
|
boolean |
hasDevice()
Checks whether the 'device' field has been set, however the value could be null
|
boolean |
hasEmployee()
Checks whether the 'employee' field has been set, however the value could be null
|
boolean |
hasMerchant()
Checks whether the 'merchant' field has been set, however the value could be null
|
boolean |
hasNote()
Checks whether the 'note' field has been set, however the value could be null
|
boolean |
hasTimestamp()
Checks whether the 'timestamp' field has been set, however the value could be null
|
boolean |
hasType()
Checks whether the 'type' field has been set, however the value could be null
|
boolean |
isNotNullAmountChange()
Checks whether the 'amountChange' field is set and is not null
|
boolean |
isNotNullDevice()
Checks whether the 'device' field is set and is not null
|
boolean |
isNotNullEmployee()
Checks whether the 'employee' field is set and is not null
|
boolean |
isNotNullMerchant()
Checks whether the 'merchant' field is set and is not null
|
boolean |
isNotNullNote()
Checks whether the 'note' field is set and is not null
|
boolean |
isNotNullTimestamp()
Checks whether the 'timestamp' field is set and is not null
|
boolean |
isNotNullType()
Checks whether the 'type' field is set and is not null
|
void |
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() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<CashEvent> CREATOR
public static final JSONifiable.Creator<CashEvent> JSON_CREATOR
public CashEvent()
protected CashEvent(boolean noInit)
public CashEvent(String json) throws IllegalArgumentException
IllegalArgumentException
public CashEvent(JSONObject jsonObject)
public CashEvent(CashEvent src)
public Type getType()
public Long getAmountChange()
public Long getTimestamp()
public String getNote()
public Employee getEmployee()
public Device getDevice()
public Reference getMerchant()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullType()
public boolean isNotNullAmountChange()
public boolean isNotNullTimestamp()
public boolean isNotNullNote()
public boolean isNotNullEmployee()
public boolean isNotNullDevice()
public boolean isNotNullMerchant()
public boolean hasType()
public boolean hasAmountChange()
public boolean hasTimestamp()
public boolean hasNote()
public boolean hasEmployee()
public boolean hasDevice()
public boolean hasMerchant()
public CashEvent setEmployee(Employee employee)
public CashEvent setDevice(Device device)
public CashEvent setMerchant(Reference merchant)
public void clearType()
public void clearAmountChange()
public void clearTimestamp()
public void clearNote()
public void clearEmployee()
public void clearDevice()
public void clearMerchant()
public boolean containsChanges()
public void resetChangeLog()
public CashEvent copyChanges()
public void mergeChanges(CashEvent src)