Package com.clover.sdk.v3.billing
Class Statement
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.billing.Statement
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class Statement extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Statement.Constraints
-
Nested classes/interfaces inherited from interface com.clover.sdk.JSONifiable
JSONifiable.Creator<T>
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<Statement>
CREATOR
static JSONifiable.Creator<Statement>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description Statement()
Constructs a new empty instance.protected
Statement(boolean noInit)
Constructs a new empty instance.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.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAmount()
Clears the 'amount' field, the 'has' method for this field will now return falsevoid
clearMonth()
Clears the 'month' field, the 'has' method for this field will now return falsevoid
clearTax()
Clears the 'tax' field, the 'has' method for this field will now return falsevoid
clearYear()
Clears the 'year' field, the 'has' method for this field will now return falseboolean
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 nullboolean
hasMonth()
Checks whether the 'month' field has been set, however the value could be nullboolean
hasTax()
Checks whether the 'tax' field has been set, however the value could be nullboolean
hasYear()
Checks whether the 'year' field has been set, however the value could be nullboolean
isNotNullAmount()
Checks whether the 'amount' field is set and is not nullboolean
isNotNullMonth()
Checks whether the 'month' field is set and is not nullboolean
isNotNullTax()
Checks whether the 'tax' field is set and is not nullboolean
isNotNullYear()
Checks whether the 'year' field is set and is not nullvoid
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()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<Statement> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<Statement> JSON_CREATOR
-
-
Constructor Detail
-
Statement
public Statement()
Constructs a new empty instance.
-
Statement
protected Statement(boolean noInit)
Constructs a new empty instance.
-
Statement
public Statement(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
Statement
public 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
public Statement(Statement src)
Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
-
-
Method Detail
-
getYear
public Integer getYear()
-
getMonth
public Integer getMonth()
-
getAmount
public Long getAmount()
-
getTax
public Long getTax()
-
getGenericClient
protected GenericClient getGenericClient()
- Specified by:
getGenericClient
in classGenericParcelable
-
getJSONObject
public 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.- Specified by:
getJSONObject
in interfaceJSONifiable
-
isNotNullYear
public boolean isNotNullYear()
Checks whether the 'year' field is set and is not null
-
isNotNullMonth
public boolean isNotNullMonth()
Checks whether the 'month' field is set and is not null
-
isNotNullAmount
public boolean isNotNullAmount()
Checks whether the 'amount' field is set and is not null
-
isNotNullTax
public boolean isNotNullTax()
Checks whether the 'tax' field is set and is not null
-
hasYear
public boolean hasYear()
Checks whether the 'year' field has been set, however the value could be null
-
hasMonth
public boolean hasMonth()
Checks whether the 'month' field has been set, however the value could be null
-
hasAmount
public boolean hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
-
hasTax
public boolean hasTax()
Checks whether the 'tax' field has been set, however the value could be null
-
clearYear
public void clearYear()
Clears the 'year' field, the 'has' method for this field will now return false
-
clearMonth
public void clearMonth()
Clears the 'month' field, the 'has' method for this field will now return false
-
clearAmount
public void clearAmount()
Clears the 'amount' field, the 'has' method for this field will now return false
-
clearTax
public void clearTax()
Clears the 'tax' field, the 'has' method for this field will now return false
-
containsChanges
public boolean containsChanges()
Returns true if this instance has any changes.
-
resetChangeLog
public void resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
-
copyChanges
public Statement copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(Statement src)
Copy all the changed fields from the given source to this instance.
-
-