public class KeyedSummary extends GenericParcelable implements Validator, JSONifiable
An object containing all of the fields of a Summary plus one additional key (groupByString). This object is useful for mapping the result set of a SQL query which selects Summaries using a GROUP BY clause.
Modifier and Type | Class and Description |
---|---|
static interface |
KeyedSummary.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<KeyedSummary> |
CREATOR |
static JSONifiable.Creator<KeyedSummary> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
KeyedSummary()
Constructs a new empty instance.
|
protected |
KeyedSummary(boolean noInit)
Constructs a new empty instance.
|
|
KeyedSummary(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.
|
|
KeyedSummary(KeyedSummary src)
Constructs a new instance that is a deep copy of the source instance.
|
|
KeyedSummary(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAmount()
Clears the 'amount' field, the 'has' method for this field will now return false
|
void |
clearGroupByField()
Clears the 'groupByField' field, the 'has' method for this field will now return false
|
void |
clearNum()
Clears the 'num' field, the 'has' method for this field will now return false
|
void |
clearServiceChargeAmount()
Clears the 'serviceChargeAmount' field, the 'has' method for this field will now return false
|
void |
clearTaxAmount()
Clears the 'taxAmount' field, the 'has' method for this field will now return false
|
void |
clearTipAmount()
Clears the 'tipAmount' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
KeyedSummary |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getAmount()
Total amount
|
protected GenericClient |
getGenericClient() |
String |
getGroupByField()
Group by field
|
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.
|
Long |
getNum()
Number of rows
|
Long |
getServiceChargeAmount()
total service charge amount
|
Long |
getTaxAmount()
total tax amount
|
Long |
getTipAmount()
Total tip amount
|
boolean |
hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
|
boolean |
hasGroupByField()
Checks whether the 'groupByField' field has been set, however the value could be null
|
boolean |
hasNum()
Checks whether the 'num' field has been set, however the value could be null
|
boolean |
hasServiceChargeAmount()
Checks whether the 'serviceChargeAmount' field has been set, however the value could be null
|
boolean |
hasTaxAmount()
Checks whether the 'taxAmount' field has been set, however the value could be null
|
boolean |
hasTipAmount()
Checks whether the 'tipAmount' field has been set, however the value could be null
|
boolean |
isNotNullAmount()
Checks whether the 'amount' field is set and is not null
|
boolean |
isNotNullGroupByField()
Checks whether the 'groupByField' field is set and is not null
|
boolean |
isNotNullNum()
Checks whether the 'num' field is set and is not null
|
boolean |
isNotNullServiceChargeAmount()
Checks whether the 'serviceChargeAmount' field is set and is not null
|
boolean |
isNotNullTaxAmount()
Checks whether the 'taxAmount' field is set and is not null
|
boolean |
isNotNullTipAmount()
Checks whether the 'tipAmount' field is set and is not null
|
void |
mergeChanges(KeyedSummary 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.
|
KeyedSummary |
setAmount(Long amount)
Sets the field 'amount'.
|
KeyedSummary |
setGroupByField(String groupByField)
Sets the field 'groupByField'.
|
KeyedSummary |
setNum(Long num)
Sets the field 'num'.
|
KeyedSummary |
setServiceChargeAmount(Long serviceChargeAmount)
Sets the field 'serviceChargeAmount'.
|
KeyedSummary |
setTaxAmount(Long taxAmount)
Sets the field 'taxAmount'.
|
KeyedSummary |
setTipAmount(Long tipAmount)
Sets the field 'tipAmount'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<KeyedSummary> CREATOR
public static final JSONifiable.Creator<KeyedSummary> JSON_CREATOR
public KeyedSummary()
protected KeyedSummary(boolean noInit)
public KeyedSummary(String json) throws IllegalArgumentException
IllegalArgumentException
public KeyedSummary(JSONObject jsonObject)
public KeyedSummary(KeyedSummary src)
public String getGroupByField()
public Long getNum()
public Long getAmount()
public Long getTipAmount()
public Long getTaxAmount()
public Long getServiceChargeAmount()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullGroupByField()
public boolean isNotNullNum()
public boolean isNotNullAmount()
public boolean isNotNullTipAmount()
public boolean isNotNullTaxAmount()
public boolean isNotNullServiceChargeAmount()
public boolean hasGroupByField()
public boolean hasNum()
public boolean hasAmount()
public boolean hasTipAmount()
public boolean hasTaxAmount()
public boolean hasServiceChargeAmount()
public KeyedSummary setGroupByField(String groupByField)
public KeyedSummary setNum(Long num)
public KeyedSummary setAmount(Long amount)
public KeyedSummary setTipAmount(Long tipAmount)
public KeyedSummary setTaxAmount(Long taxAmount)
public KeyedSummary setServiceChargeAmount(Long serviceChargeAmount)
public void clearGroupByField()
public void clearNum()
public void clearAmount()
public void clearTipAmount()
public void clearTaxAmount()
public void clearServiceChargeAmount()
public boolean containsChanges()
public void resetChangeLog()
public KeyedSummary copyChanges()
public void mergeChanges(KeyedSummary src)