public class TipSuggestion extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
TipSuggestion.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<TipSuggestion> |
CREATOR |
static JSONifiable.Creator<TipSuggestion> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
TipSuggestion()
Constructs a new empty instance.
|
protected |
TipSuggestion(boolean noInit)
Constructs a new empty instance.
|
|
TipSuggestion(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.
|
|
TipSuggestion(String json)
Constructs a new instance from the given JSON String.
|
|
TipSuggestion(TipSuggestion src)
Constructs a new instance that is a deep copy of the source instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAmount()
Clears the 'amount' field, the 'has' method for this field will now return false
|
void |
clearFlatTip()
Clears the 'flatTip' 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 |
clearIsEnabled()
Clears the 'isEnabled' field, the 'has' method for this field will now return false
|
void |
clearName()
Clears the 'name' field, the 'has' method for this field will now return false
|
void |
clearPercentage()
Clears the 'percentage' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
TipSuggestion |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getAmount()
Suggested tip amount
|
Long |
getFlatTip()
Suggested flat tip amount
|
protected GenericClient |
getGenericClient() |
String |
getId() |
Boolean |
getIsEnabled() |
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.
|
String |
getName()
Name of the tip
|
Long |
getPercentage()
Suggested tip percentage
|
boolean |
hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
|
boolean |
hasFlatTip()
Checks whether the 'flatTip' 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 |
hasIsEnabled()
Checks whether the 'isEnabled' field has been set, however the value could be null
|
boolean |
hasName()
Checks whether the 'name' field has been set, however the value could be null
|
boolean |
hasPercentage()
Checks whether the 'percentage' field has been set, however the value could be null
|
boolean |
isNotNullAmount()
Checks whether the 'amount' field is set and is not null
|
boolean |
isNotNullFlatTip()
Checks whether the 'flatTip' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullIsEnabled()
Checks whether the 'isEnabled' field is set and is not null
|
boolean |
isNotNullName()
Checks whether the 'name' field is set and is not null
|
boolean |
isNotNullPercentage()
Checks whether the 'percentage' field is set and is not null
|
void |
mergeChanges(TipSuggestion 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.
|
TipSuggestion |
setAmount(Long amount)
Sets the field 'amount'.
|
TipSuggestion |
setFlatTip(Long flatTip)
Sets the field 'flatTip'.
|
TipSuggestion |
setId(String id)
Sets the field 'id'.
|
TipSuggestion |
setIsEnabled(Boolean isEnabled)
Sets the field 'isEnabled'.
|
TipSuggestion |
setName(String name)
Sets the field 'name'.
|
TipSuggestion |
setPercentage(Long percentage)
Sets the field 'percentage'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<TipSuggestion> CREATOR
public static final JSONifiable.Creator<TipSuggestion> JSON_CREATOR
public TipSuggestion()
protected TipSuggestion(boolean noInit)
public TipSuggestion(String json) throws IllegalArgumentException
IllegalArgumentException
public TipSuggestion(JSONObject jsonObject)
public TipSuggestion(TipSuggestion src)
public String getId()
public String getName()
public Long getPercentage()
public Long getAmount()
public Boolean getIsEnabled()
public Long getFlatTip()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullName()
public boolean isNotNullPercentage()
public boolean isNotNullAmount()
public boolean isNotNullIsEnabled()
public boolean isNotNullFlatTip()
public boolean hasId()
public boolean hasName()
public boolean hasPercentage()
public boolean hasAmount()
public boolean hasIsEnabled()
public boolean hasFlatTip()
public TipSuggestion setId(String id)
public TipSuggestion setName(String name)
public TipSuggestion setPercentage(Long percentage)
public TipSuggestion setAmount(Long amount)
public TipSuggestion setIsEnabled(Boolean isEnabled)
public TipSuggestion setFlatTip(Long flatTip)
public void clearId()
public void clearName()
public void clearPercentage()
public void clearAmount()
public void clearIsEnabled()
public void clearFlatTip()
public boolean containsChanges()
public void resetChangeLog()
public TipSuggestion copyChanges()
public void mergeChanges(TipSuggestion src)