public class TableOrder extends GenericParcelable implements Validator, JSONifiable
TableOrder object that associates the table and order together for orders created in Tables 2.0
Modifier and Type | Class and Description |
---|---|
static interface |
TableOrder.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<TableOrder> |
CREATOR |
static JSONifiable.Creator<TableOrder> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
TableOrder()
Constructs a new empty instance.
|
protected |
TableOrder(boolean noInit)
Constructs a new empty instance.
|
|
TableOrder(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.
|
|
TableOrder(String json)
Constructs a new instance from the given JSON String.
|
|
TableOrder(TableOrder src)
Constructs a new instance that is a deep copy of the source instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCreatedTime()
Clears the 'createdTime' field, the 'has' method for this field will now return false
|
void |
clearDeletedTime()
Clears the 'deletedTime' field, the 'has' method for this field will now return false
|
void |
clearGuests()
Clears the 'guests' field, the 'has' method for this field will now return false
|
void |
clearId()
Clears the 'id' 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 |
clearModifiedTime()
Clears the 'modifiedTime' field, the 'has' method for this field will now return false
|
void |
clearOrder()
Clears the 'order' field, the 'has' method for this field will now return false
|
void |
clearTable()
Clears the 'table' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
TableOrder |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getCreatedTime()
Timestamp when the TableOrder was created
|
Long |
getDeletedTime()
Timestamp when TableOrder was last deleted
|
protected GenericClient |
getGenericClient() |
List<GuestV2> |
getGuests()
Guests associated with this table
|
String |
getId()
Unique identifier
|
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.
|
Merchant |
getMerchant()
The merchant the TableOrder object belongs to
|
Long |
getModifiedTime()
Timestamp when the TableOrder was last modified
|
Order |
getOrder()
The order associated to the table
|
Table |
getTable()
The table the order belongs to
|
boolean |
hasCreatedTime()
Checks whether the 'createdTime' field has been set, however the value could be null
|
boolean |
hasDeletedTime()
Checks whether the 'deletedTime' field has been set, however the value could be null
|
boolean |
hasGuests()
Checks whether the 'guests' field has been set, however the value could be null
|
boolean |
hasId()
Checks whether the 'id' 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 |
hasModifiedTime()
Checks whether the 'modifiedTime' field has been set, however the value could be null
|
boolean |
hasOrder()
Checks whether the 'order' field has been set, however the value could be null
|
boolean |
hasTable()
Checks whether the 'table' field has been set, however the value could be null
|
boolean |
isNotEmptyGuests()
Checks whether the 'guests' field is set and is not null and is not empty
|
boolean |
isNotNullCreatedTime()
Checks whether the 'createdTime' field is set and is not null
|
boolean |
isNotNullDeletedTime()
Checks whether the 'deletedTime' field is set and is not null
|
boolean |
isNotNullGuests()
Checks whether the 'guests' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullMerchant()
Checks whether the 'merchant' field is set and is not null
|
boolean |
isNotNullModifiedTime()
Checks whether the 'modifiedTime' field is set and is not null
|
boolean |
isNotNullOrder()
Checks whether the 'order' field is set and is not null
|
boolean |
isNotNullTable()
Checks whether the 'table' field is set and is not null
|
void |
mergeChanges(TableOrder 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.
|
TableOrder |
setCreatedTime(Long createdTime)
Sets the field 'createdTime'.
|
TableOrder |
setDeletedTime(Long deletedTime)
Sets the field 'deletedTime'.
|
TableOrder |
setGuests(List<GuestV2> guests)
Sets the field 'guests'.
|
TableOrder |
setId(String id)
Sets the field 'id'.
|
TableOrder |
setMerchant(Merchant merchant)
Sets the field 'merchant'.
|
TableOrder |
setModifiedTime(Long modifiedTime)
Sets the field 'modifiedTime'.
|
TableOrder |
setOrder(Order order)
Sets the field 'order'.
|
TableOrder |
setTable(Table table)
Sets the field 'table'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<TableOrder> CREATOR
public static final JSONifiable.Creator<TableOrder> JSON_CREATOR
public TableOrder()
protected TableOrder(boolean noInit)
public TableOrder(String json) throws IllegalArgumentException
IllegalArgumentException
public TableOrder(JSONObject jsonObject)
public TableOrder(TableOrder src)
public String getId()
public Table getTable()
public Order getOrder()
public Merchant getMerchant()
public Long getCreatedTime()
public Long getModifiedTime()
public Long getDeletedTime()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullTable()
public boolean isNotNullGuests()
public boolean isNotEmptyGuests()
public boolean isNotNullOrder()
public boolean isNotNullMerchant()
public boolean isNotNullCreatedTime()
public boolean isNotNullModifiedTime()
public boolean isNotNullDeletedTime()
public boolean hasId()
public boolean hasTable()
public boolean hasGuests()
public boolean hasOrder()
public boolean hasMerchant()
public boolean hasCreatedTime()
public boolean hasModifiedTime()
public boolean hasDeletedTime()
public TableOrder setId(String id)
public TableOrder setTable(Table table)
public TableOrder setGuests(List<GuestV2> guests)
public TableOrder setOrder(Order order)
public TableOrder setMerchant(Merchant merchant)
public TableOrder setCreatedTime(Long createdTime)
public TableOrder setModifiedTime(Long modifiedTime)
public TableOrder setDeletedTime(Long deletedTime)
public void clearId()
public void clearTable()
public void clearGuests()
public void clearOrder()
public void clearMerchant()
public void clearCreatedTime()
public void clearModifiedTime()
public void clearDeletedTime()
public boolean containsChanges()
public void resetChangeLog()
public TableOrder copyChanges()
public void mergeChanges(TableOrder src)