public class ServiceCharge extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
ServiceCharge.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<ServiceCharge> |
CREATOR |
static JSONifiable.Creator<ServiceCharge> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
ServiceCharge()
Constructs a new empty instance.
|
protected |
ServiceCharge(boolean noInit)
Constructs a new empty instance.
|
|
ServiceCharge(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.
|
|
ServiceCharge(ServiceCharge src)
Constructs a new instance that is a deep copy of the source instance.
|
|
ServiceCharge(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearEnabled()
Clears the 'enabled' 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 |
clearIsAutoApplied()
Clears the 'isAutoGratuityApplied' 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
|
void |
clearPercentageDecimal()
Clears the 'percentageDecimal' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
ServiceCharge |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Boolean |
getEnabled()
If this service charge is enabled
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
Boolean |
getIsAutoApplied()
Returns if service charge is auto applied (auto-gratuity).
|
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()
Service charge name
|
Long |
getPercentage()
Deprecated.
|
Long |
getPercentageDecimal()
Percent to charge times 10000, e.g.
|
boolean |
hasEnabled()
Checks whether the 'enabled' 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 |
hasIsAutoApplied()
Checks whether the 'isAutoGratuityApplied' 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 |
hasPercentageDecimal()
Checks whether the 'percentageDecimal' field has been set, however the value could be null
|
boolean |
isNotNullEnabled()
Checks whether the 'enabled' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullisAutoApplied()
Checks whether the 'isAutoGratuityApplied' 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
|
boolean |
isNotNullPercentageDecimal()
Checks whether the 'percentageDecimal' field is set and is not null
|
void |
mergeChanges(ServiceCharge 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.
|
ServiceCharge |
setEnabled(Boolean enabled)
Sets the field 'enabled'.
|
ServiceCharge |
setId(String id)
Sets the field 'id'.
|
ServiceCharge |
setIsAutoApplied(Boolean isAutoApplied)
Sets the field 'isAutoApplied'.
|
ServiceCharge |
setName(String name)
Sets the field 'name'.
|
ServiceCharge |
setPercentage(Long percentage)
Sets the field 'percentage'.
|
ServiceCharge |
setPercentageDecimal(Long percentageDecimal)
Sets the field 'percentageDecimal'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<ServiceCharge> CREATOR
public static final JSONifiable.Creator<ServiceCharge> JSON_CREATOR
public ServiceCharge()
protected ServiceCharge(boolean noInit)
public ServiceCharge(String json) throws IllegalArgumentException
IllegalArgumentException
public ServiceCharge(JSONObject jsonObject)
public ServiceCharge(ServiceCharge src)
public String getId()
public String getName()
public Boolean getEnabled()
@Deprecated public Long getPercentage()
public Long getPercentageDecimal()
public Boolean getIsAutoApplied()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullName()
public boolean isNotNullEnabled()
public boolean isNotNullPercentage()
public boolean isNotNullPercentageDecimal()
public boolean isNotNullisAutoApplied()
public boolean hasId()
public boolean hasName()
public boolean hasEnabled()
public boolean hasPercentage()
public boolean hasPercentageDecimal()
public boolean hasIsAutoApplied()
public ServiceCharge setId(String id)
public ServiceCharge setName(String name)
public ServiceCharge setEnabled(Boolean enabled)
public ServiceCharge setPercentage(Long percentage)
public ServiceCharge setPercentageDecimal(Long percentageDecimal)
public ServiceCharge setIsAutoApplied(Boolean isAutoApplied)
public void clearId()
public void clearName()
public void clearEnabled()
public void clearPercentage()
public void clearPercentageDecimal()
public void clearIsAutoApplied()
public boolean containsChanges()
public void resetChangeLog()
public ServiceCharge copyChanges()
public void mergeChanges(ServiceCharge src)