public class Statement extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
Statement.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Statement> |
CREATOR |
static JSONifiable.Creator<Statement> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Statement()
Constructs a new empty instance.
|
protected |
Statement(boolean noInit)
Constructs a new empty instance.
|
|
Statement(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.
|
|
Statement(Statement src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Statement(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 |
clearMonth()
Clears the 'month' field, the 'has' method for this field will now return false
|
void |
clearTax()
Clears the 'tax' field, the 'has' method for this field will now return false
|
void |
clearYear()
Clears the 'year' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Statement |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getAmount() |
protected GenericClient |
getGenericClient() |
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.
|
Integer |
getMonth() |
Long |
getTax() |
Integer |
getYear() |
boolean |
hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
|
boolean |
hasMonth()
Checks whether the 'month' field has been set, however the value could be null
|
boolean |
hasTax()
Checks whether the 'tax' field has been set, however the value could be null
|
boolean |
hasYear()
Checks whether the 'year' field has been set, however the value could be null
|
boolean |
isNotNullAmount()
Checks whether the 'amount' field is set and is not null
|
boolean |
isNotNullMonth()
Checks whether the 'month' field is set and is not null
|
boolean |
isNotNullTax()
Checks whether the 'tax' field is set and is not null
|
boolean |
isNotNullYear()
Checks whether the 'year' field is set and is not null
|
void |
mergeChanges(Statement 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.
|
Statement |
setAmount(Long amount)
Sets the field 'amount'.
|
Statement |
setMonth(Integer month)
Sets the field 'month'.
|
Statement |
setTax(Long tax)
Sets the field 'tax'.
|
Statement |
setYear(Integer year)
Sets the field 'year'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Statement> CREATOR
public static final JSONifiable.Creator<Statement> JSON_CREATOR
public Statement()
protected Statement(boolean noInit)
public Statement(String json) throws IllegalArgumentException
IllegalArgumentException
public Statement(JSONObject jsonObject)
public Statement(Statement src)
public Integer getYear()
public Integer getMonth()
public Long getAmount()
public Long getTax()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullYear()
public boolean isNotNullMonth()
public boolean isNotNullAmount()
public boolean isNotNullTax()
public boolean hasYear()
public boolean hasMonth()
public boolean hasAmount()
public boolean hasTax()
public void clearYear()
public void clearMonth()
public void clearAmount()
public void clearTax()
public boolean containsChanges()
public void resetChangeLog()
public Statement copyChanges()
public void mergeChanges(Statement src)