public class Reference extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
Reference.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Reference> |
CREATOR |
static JSONifiable.Creator<Reference> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Reference()
Constructs a new empty instance.
|
protected |
Reference(boolean noInit)
Constructs a new empty instance.
|
|
Reference(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.
|
|
Reference(Reference src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Reference(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
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Reference |
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
|
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.
|
boolean |
hasId()
Checks whether the 'id' field has been set, however the value could be null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
void |
mergeChanges(Reference 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.
|
Reference |
setId(String id)
Sets the field 'id'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Reference> CREATOR
public static final JSONifiable.Creator<Reference> JSON_CREATOR
public Reference()
protected Reference(boolean noInit)
public Reference(String json) throws IllegalArgumentException
IllegalArgumentException
public Reference(JSONObject jsonObject)
public Reference(Reference src)
public String getId()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean hasId()
public void clearId()
public boolean containsChanges()
public void resetChangeLog()
public Reference copyChanges()
public void mergeChanges(Reference src)