public class HappyHourDiscount extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
HappyHourDiscount.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<HappyHourDiscount> |
CREATOR |
static JSONifiable.Creator<HappyHourDiscount> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
HappyHourDiscount()
Constructs a new empty instance.
|
protected |
HappyHourDiscount(boolean noInit)
Constructs a new empty instance.
|
|
HappyHourDiscount(HappyHourDiscount src)
Constructs a new instance that is a deep copy of the source instance.
|
|
HappyHourDiscount(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.
|
|
HappyHourDiscount(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 |
clearBeginTimeHours()
Clears the 'beginTimeHours' field, the 'has' method for this field will now return false
|
void |
clearBeginTimeMinutes()
Clears the 'beginTimeMinutes' field, the 'has' method for this field will now return false
|
void |
clearCategoryIds()
Clears the 'categoryIds' field, the 'has' method for this field will now return false
|
void |
clearDaysOfWeek()
Clears the 'daysOfWeek' field, the 'has' method for this field will now return false
|
void |
clearEndTimeHours()
Clears the 'endTimeHours' field, the 'has' method for this field will now return false
|
void |
clearEndTimeMinutes()
Clears the 'endTimeMinutes' 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 |
clearItemIds()
Clears the 'itemIds' 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.
|
HappyHourDiscount |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getAmount()
Discount amount in currency units(e.g.
|
Integer |
getBeginTimeHours()
Discount begin hours time
|
Integer |
getBeginTimeMinutes()
Discount begin time minutes
|
List<String> |
getCategoryIds()
list of category ids associated with this discount.
|
List<String> |
getDaysOfWeek()
Days of week on which this discount is applicable
|
Integer |
getEndTimeHours()
Discount end hours time
|
Integer |
getEndTimeMinutes()
Discount end time minutes
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
List<String> |
getItemIds()
list of item ids associated with this discount.
|
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 discount
|
Long |
getPercentage()
Discount amount in percent
|
boolean |
hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
|
boolean |
hasBeginTimeHours()
Checks whether the 'beginTimeHours' field has been set, however the value could be null
|
boolean |
hasBeginTimeMinutes()
Checks whether the 'beginTimeMinutes' field has been set, however the value could be null
|
boolean |
hasCategoryIds()
Checks whether the 'categoryIds' field has been set, however the value could be null
|
boolean |
hasDaysOfWeek()
Checks whether the 'daysOfWeek' field has been set, however the value could be null
|
boolean |
hasEndTimeHours()
Checks whether the 'endTimeHours' field has been set, however the value could be null
|
boolean |
hasEndTimeMinutes()
Checks whether the 'endTimeMinutes' 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 |
hasItemIds()
Checks whether the 'itemIds' 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 |
isNotEmptyCategoryIds()
Checks whether the 'categoryIds' field is set and is not null and is not empty
|
boolean |
isNotEmptyDaysOfWeek()
Checks whether the 'daysOfWeek' field is set and is not null and is not empty
|
boolean |
isNotEmptyItemIds()
Checks whether the 'itemIds' field is set and is not null and is not empty
|
boolean |
isNotNullAmount()
Checks whether the 'amount' field is set and is not null
|
boolean |
isNotNullBeginTimeHours()
Checks whether the 'beginTimeHours' field is set and is not null
|
boolean |
isNotNullBeginTimeMinutes()
Checks whether the 'beginTimeMinutes' field is set and is not null
|
boolean |
isNotNullCategoryIds()
Checks whether the 'categoryIds' field is set and is not null
|
boolean |
isNotNullDaysOfWeek()
Checks whether the 'daysOfWeek' field is set and is not null
|
boolean |
isNotNullEndTimeHours()
Checks whether the 'endTimeHours' field is set and is not null
|
boolean |
isNotNullEndTimeMinutes()
Checks whether the 'endTimeMinutes' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullItemIds()
Checks whether the 'itemIds' 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(HappyHourDiscount 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.
|
HappyHourDiscount |
setAmount(Long amount)
Sets the field 'amount'.
|
HappyHourDiscount |
setBeginTimeHours(Integer beginTimeHours)
Sets the field 'beginTimeHours'.
|
HappyHourDiscount |
setBeginTimeMinutes(Integer beginTimeMinutes)
Sets the field 'beginTimeMinutes'.
|
HappyHourDiscount |
setCategoryIds(List<String> categoryIds)
Sets the field 'categoryIds'.
|
HappyHourDiscount |
setDaysOfWeek(List<String> daysOfWeek)
Sets the field 'daysOfWeek'.
|
HappyHourDiscount |
setEndTimeHours(Integer endTimeHours)
Sets the field 'endTimeHours'.
|
HappyHourDiscount |
setEndTimeMinutes(Integer endTimeMinutes)
Sets the field 'endTimeMinutes'.
|
HappyHourDiscount |
setId(String id)
Sets the field 'id'.
|
HappyHourDiscount |
setItemIds(List<String> itemIds)
Sets the field 'itemIds'.
|
HappyHourDiscount |
setName(String name)
Sets the field 'name'.
|
HappyHourDiscount |
setPercentage(Long percentage)
Sets the field 'percentage'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<HappyHourDiscount> CREATOR
public static final JSONifiable.Creator<HappyHourDiscount> JSON_CREATOR
public HappyHourDiscount()
protected HappyHourDiscount(boolean noInit)
public HappyHourDiscount(String json) throws IllegalArgumentException
IllegalArgumentException
public HappyHourDiscount(JSONObject jsonObject)
public HappyHourDiscount(HappyHourDiscount src)
public String getId()
public String getName()
public Long getAmount()
public Long getPercentage()
public Integer getBeginTimeHours()
public Integer getEndTimeHours()
public Integer getBeginTimeMinutes()
public Integer getEndTimeMinutes()
public List<String> getCategoryIds()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullName()
public boolean isNotNullAmount()
public boolean isNotNullPercentage()
public boolean isNotNullBeginTimeHours()
public boolean isNotNullEndTimeHours()
public boolean isNotNullBeginTimeMinutes()
public boolean isNotNullEndTimeMinutes()
public boolean isNotNullCategoryIds()
public boolean isNotEmptyCategoryIds()
public boolean isNotNullItemIds()
public boolean isNotEmptyItemIds()
public boolean isNotNullDaysOfWeek()
public boolean isNotEmptyDaysOfWeek()
public boolean hasId()
public boolean hasName()
public boolean hasAmount()
public boolean hasPercentage()
public boolean hasBeginTimeHours()
public boolean hasEndTimeHours()
public boolean hasBeginTimeMinutes()
public boolean hasEndTimeMinutes()
public boolean hasCategoryIds()
public boolean hasItemIds()
public boolean hasDaysOfWeek()
public HappyHourDiscount setId(String id)
public HappyHourDiscount setName(String name)
public HappyHourDiscount setAmount(Long amount)
public HappyHourDiscount setPercentage(Long percentage)
public HappyHourDiscount setBeginTimeHours(Integer beginTimeHours)
public HappyHourDiscount setEndTimeHours(Integer endTimeHours)
public HappyHourDiscount setBeginTimeMinutes(Integer beginTimeMinutes)
public HappyHourDiscount setEndTimeMinutes(Integer endTimeMinutes)
public HappyHourDiscount setCategoryIds(List<String> categoryIds)
public HappyHourDiscount setItemIds(List<String> itemIds)
public HappyHourDiscount setDaysOfWeek(List<String> daysOfWeek)
public void clearId()
public void clearName()
public void clearAmount()
public void clearPercentage()
public void clearBeginTimeHours()
public void clearEndTimeHours()
public void clearBeginTimeMinutes()
public void clearEndTimeMinutes()
public void clearCategoryIds()
public void clearItemIds()
public void clearDaysOfWeek()
public boolean containsChanges()
public void resetChangeLog()
public HappyHourDiscount copyChanges()
public void mergeChanges(HappyHourDiscount src)