public class Category extends GenericParcelable implements Validator, JSONifiable
IInventoryService
Modifier and Type | Class and Description |
---|---|
static interface |
Category.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Category> |
CREATOR |
static JSONifiable.Creator<Category> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Category()
Constructs a new empty instance.
|
protected |
Category(boolean noInit)
Constructs a new empty instance.
|
|
Category(Category src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Category(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.
|
|
Category(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCanonical()
Clears the 'canonical' field, the 'has' method for this field will now return false
|
void |
clearColorCode()
Clears the 'colorCode' field, the 'has' method for this field will now return false
|
void |
clearDeleted()
Clears the 'deleted' 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 |
clearItems()
Clears the 'items' field, the 'has' method for this field will now return false
|
void |
clearMenuSection()
Clears the 'menuSection' 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 |
clearName()
Clears the 'name' field, the 'has' method for this field will now return false
|
void |
clearSortOrder()
Clears the 'sortOrder' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Category |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Reference |
getCanonical()
Reference to canonical category
|
String |
getColorCode()
Hex code representation of the color assigned to this category and its items, in the form of #fff, #ffffff, or #ffffffff
|
Boolean |
getDeleted()
Whether the category has been deleted.
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
List<Reference> |
getItems()
Ordered list of items associated with this category.
|
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.
|
MenuSection |
getMenuSection()
Menu Section attribute that can be expanded to menu section specific attributes
|
Long |
getModifiedTime()
The time this category was last modified
|
String |
getName()
The name of the category which will appear in Clover Register App.
|
Integer |
getSortOrder()
Integer used to determine how this category is sorted against other categories.
|
boolean |
hasCanonical()
Checks whether the 'canonical' field has been set, however the value could be null
|
boolean |
hasColorCode()
Checks whether the 'colorCode' field has been set, however the value could be null
|
boolean |
hasDeleted()
Checks whether the 'deleted' 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 |
hasItems()
Checks whether the 'items' field has been set, however the value could be null
|
boolean |
hasMenuSection()
Checks whether the 'menuSection' 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 |
hasName()
Checks whether the 'name' field has been set, however the value could be null
|
boolean |
hasSortOrder()
Checks whether the 'sortOrder' field has been set, however the value could be null
|
boolean |
isNotEmptyItems()
Checks whether the 'items' field is set and is not null and is not empty
|
boolean |
isNotNullCanonical()
Checks whether the 'canonical' field is set and is not null
|
boolean |
isNotNullColorCode()
Checks whether the 'colorCode' field is set and is not null
|
boolean |
isNotNullDeleted()
Checks whether the 'deleted' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullItems()
Checks whether the 'items' field is set and is not null
|
boolean |
isNotNullMenuSection()
Checks whether the 'menuSection' field is set and is not null
|
boolean |
isNotNullModifiedTime()
Checks whether the 'modifiedTime' field is set and is not null
|
boolean |
isNotNullName()
Checks whether the 'name' field is set and is not null
|
boolean |
isNotNullSortOrder()
Checks whether the 'sortOrder' field is set and is not null
|
void |
mergeChanges(Category 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.
|
Category |
setCanonical(Reference canonical)
Sets the field 'canonical'.
|
Category |
setColorCode(String colorCode)
Sets the field 'colorCode'.
|
Category |
setDeleted(Boolean deleted)
Sets the field 'deleted'.
|
Category |
setId(String id)
Sets the field 'id'.
|
Category |
setItems(List<Reference> items)
Sets the field 'items'.
|
Category |
setMenuSection(MenuSection menuSection)
Sets the field 'menuSection'.
|
Category |
setModifiedTime(Long modifiedTime)
Sets the field 'modifiedTime'.
|
Category |
setName(String name)
Sets the field 'name'.
|
Category |
setSortOrder(Integer sortOrder)
Sets the field 'sortOrder'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Category> CREATOR
public static final JSONifiable.Creator<Category> JSON_CREATOR
public Category()
protected Category(boolean noInit)
public Category(String json) throws IllegalArgumentException
IllegalArgumentException
public Category(JSONObject jsonObject)
public Category(Category src)
public String getId()
public String getName()
public Integer getSortOrder()
public String getColorCode()
public Boolean getDeleted()
public Long getModifiedTime()
public Reference getCanonical()
public MenuSection getMenuSection()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullName()
public boolean isNotNullSortOrder()
public boolean isNotNullItems()
public boolean isNotEmptyItems()
public boolean isNotNullColorCode()
public boolean isNotNullDeleted()
public boolean isNotNullModifiedTime()
public boolean isNotNullCanonical()
public boolean isNotNullMenuSection()
public boolean hasId()
public boolean hasName()
public boolean hasSortOrder()
public boolean hasItems()
public boolean hasColorCode()
public boolean hasDeleted()
public boolean hasModifiedTime()
public boolean hasCanonical()
public boolean hasMenuSection()
public Category setItems(List<Reference> items)
public Category setCanonical(Reference canonical)
public Category setMenuSection(MenuSection menuSection)
public void clearId()
public void clearName()
public void clearSortOrder()
public void clearItems()
public void clearColorCode()
public void clearDeleted()
public void clearModifiedTime()
public void clearCanonical()
public void clearMenuSection()
public boolean containsChanges()
public void resetChangeLog()
public Category copyChanges()
public void mergeChanges(Category src)