public class SummarySection extends GenericParcelable implements Validator, JSONifiable
Combines a collection of rows with a total to form a section in payments API's
Modifier and Type | Class and Description |
---|---|
static interface |
SummarySection.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<SummarySection> |
CREATOR |
static JSONifiable.Creator<SummarySection> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
SummarySection()
Constructs a new empty instance.
|
protected |
SummarySection(boolean noInit)
Constructs a new empty instance.
|
|
SummarySection(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.
|
|
SummarySection(String json)
Constructs a new instance from the given JSON String.
|
|
SummarySection(SummarySection src)
Constructs a new instance that is a deep copy of the source instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clearMajorLabelsExist()
Clears the 'majorLabelsExist' field, the 'has' method for this field will now return false
|
void |
clearRows()
Clears the 'rows' field, the 'has' method for this field will now return false
|
void |
clearTotal()
Clears the 'total' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
SummarySection |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
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.
|
Boolean |
getMajorLabelsExist()
Optional flag used for revenue class to indicate whether the merchant has any labels marked 'Show in Reporting?'
|
List<Summary> |
getRows()
The detail rows of a particular section of a payments API
|
Summary |
getTotal()
The sum of the above rows
|
boolean |
hasMajorLabelsExist()
Checks whether the 'majorLabelsExist' field has been set, however the value could be null
|
boolean |
hasRows()
Checks whether the 'rows' field has been set, however the value could be null
|
boolean |
hasTotal()
Checks whether the 'total' field has been set, however the value could be null
|
boolean |
isNotEmptyRows()
Checks whether the 'rows' field is set and is not null and is not empty
|
boolean |
isNotNullMajorLabelsExist()
Checks whether the 'majorLabelsExist' field is set and is not null
|
boolean |
isNotNullRows()
Checks whether the 'rows' field is set and is not null
|
boolean |
isNotNullTotal()
Checks whether the 'total' field is set and is not null
|
void |
mergeChanges(SummarySection 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.
|
SummarySection |
setMajorLabelsExist(Boolean majorLabelsExist)
Sets the field 'majorLabelsExist'.
|
SummarySection |
setRows(List<Summary> rows)
Sets the field 'rows'.
|
SummarySection |
setTotal(Summary total)
Sets the field 'total'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<SummarySection> CREATOR
public static final JSONifiable.Creator<SummarySection> JSON_CREATOR
public SummarySection()
protected SummarySection(boolean noInit)
public SummarySection(String json) throws IllegalArgumentException
IllegalArgumentException
public SummarySection(JSONObject jsonObject)
public SummarySection(SummarySection src)
public Summary getTotal()
public Boolean getMajorLabelsExist()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullRows()
public boolean isNotEmptyRows()
public boolean isNotNullTotal()
public boolean isNotNullMajorLabelsExist()
public boolean hasRows()
public boolean hasTotal()
public boolean hasMajorLabelsExist()
public SummarySection setRows(List<Summary> rows)
public SummarySection setTotal(Summary total)
public SummarySection setMajorLabelsExist(Boolean majorLabelsExist)
public void clearRows()
public void clearTotal()
public void clearMajorLabelsExist()
public boolean containsChanges()
public void resetChangeLog()
public SummarySection copyChanges()
public void mergeChanges(SummarySection src)