public class Attribute extends GenericParcelable implements Validator, JSONifiable
IInventoryService
Modifier and Type | Class and Description |
---|---|
static interface |
Attribute.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Attribute> |
CREATOR |
static JSONifiable.Creator<Attribute> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Attribute()
Constructs a new empty instance.
|
|
Attribute(Attribute src)
Constructs a new instance that is a deep copy of the source instance.
|
protected |
Attribute(boolean noInit)
Constructs a new empty instance.
|
|
Attribute(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.
|
|
Attribute(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearId()
Clears the 'id' field, the 'has' method for this field will now return false
|
void |
clearItemGroup()
Clears the 'itemGroup' 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 |
clearOptions()
Clears the 'options' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Attribute |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
Reference |
getItemGroup()
The item group this attribute belongs to
|
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 this attribute
|
List<Option> |
getOptions()
Options associated with this attribute
|
boolean |
hasId()
Checks whether the 'id' field has been set, however the value could be null
|
boolean |
hasItemGroup()
Checks whether the 'itemGroup' 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 |
hasOptions()
Checks whether the 'options' field has been set, however the value could be null
|
boolean |
isNotEmptyOptions()
Checks whether the 'options' field is set and is not null and is not empty
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullItemGroup()
Checks whether the 'itemGroup' field is set and is not null
|
boolean |
isNotNullName()
Checks whether the 'name' field is set and is not null
|
boolean |
isNotNullOptions()
Checks whether the 'options' field is set and is not null
|
void |
mergeChanges(Attribute 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.
|
Attribute |
setId(String id)
Sets the field 'id'.
|
Attribute |
setItemGroup(Reference itemGroup)
Sets the field 'itemGroup'.
|
Attribute |
setName(String name)
Sets the field 'name'.
|
Attribute |
setOptions(List<Option> options)
Sets the field 'options'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Attribute> CREATOR
public static final JSONifiable.Creator<Attribute> JSON_CREATOR
public Attribute()
protected Attribute(boolean noInit)
public Attribute(String json) throws IllegalArgumentException
IllegalArgumentException
public Attribute(JSONObject jsonObject)
public Attribute(Attribute src)
public String getId()
public String getName()
public Reference getItemGroup()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullName()
public boolean isNotNullItemGroup()
public boolean isNotNullOptions()
public boolean isNotEmptyOptions()
public boolean hasId()
public boolean hasName()
public boolean hasItemGroup()
public boolean hasOptions()
public Attribute setItemGroup(Reference itemGroup)
public Attribute setOptions(List<Option> options)
public void clearId()
public void clearName()
public void clearItemGroup()
public void clearOptions()
public boolean containsChanges()
public void resetChangeLog()
public Attribute copyChanges()
public void mergeChanges(Attribute src)