Package com.clover.sdk.v3.payments
Class LineItemPayment
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.payments.LineItemPayment
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class LineItemPayment extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LineItemPayment.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<LineItemPayment>
CREATOR
static JSONifiable.Creator<LineItemPayment>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description LineItemPayment()
Constructs a new empty instance.protected
LineItemPayment(boolean noInit)
Constructs a new empty instance.LineItemPayment(LineItemPayment src)
Constructs a new instance that is a deep copy of the source instance.LineItemPayment(String json)
Constructs a new instance from the given JSON String.LineItemPayment(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
clearBinName()
Clears the 'binName' field, the 'has' method for this field will now return falsevoid
clearId()
Clears the 'id' field, the 'has' method for this field will now return falsevoid
clearPercentage()
Clears the 'percentage' field, the 'has' method for this field will now return falsevoid
clearRefunded()
Clears the 'refunded' field, the 'has' method for this field will now return falseboolean
containsChanges()
Returns true if this instance has any changes.LineItemPayment
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.String
getBinName()
Bin this line item payment was forprotected GenericClient
getGenericClient()
String
getId()
Unique identifier; TBD this is confusing because it's used as either line item id or payment idJSONObject
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.Long
getPercentage()
Percent of this line item covered by this paymentBoolean
getRefunded()
Payment has been refundedboolean
hasBinName()
Checks whether the 'binName' field has been set, however the value could be nullboolean
hasId()
Checks whether the 'id' field has been set, however the value could be nullboolean
hasPercentage()
Checks whether the 'percentage' field has been set, however the value could be nullboolean
hasRefunded()
Checks whether the 'refunded' field has been set, however the value could be nullboolean
isNotNullBinName()
Checks whether the 'binName' field is set and is not nullboolean
isNotNullId()
Checks whether the 'id' field is set and is not nullboolean
isNotNullPercentage()
Checks whether the 'percentage' field is set and is not nullboolean
isNotNullRefunded()
Checks whether the 'refunded' field is set and is not nullvoid
mergeChanges(LineItemPayment 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.LineItemPayment
setBinName(String binName)
Sets the field 'binName'.LineItemPayment
setId(String id)
Sets the field 'id'.LineItemPayment
setPercentage(Long percentage)
Sets the field 'percentage'.LineItemPayment
setRefunded(Boolean refunded)
Sets the field 'refunded'.void
validate()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<LineItemPayment> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<LineItemPayment> JSON_CREATOR
-
-
Constructor Detail
-
LineItemPayment
public LineItemPayment()
Constructs a new empty instance.
-
LineItemPayment
protected LineItemPayment(boolean noInit)
Constructs a new empty instance.
-
LineItemPayment
public LineItemPayment(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
LineItemPayment
public LineItemPayment(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.
-
LineItemPayment
public LineItemPayment(LineItemPayment src)
Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
-
-
Method Detail
-
getId
public String getId()
Unique identifier; TBD this is confusing because it's used as either line item id or payment id
-
getPercentage
public Long getPercentage()
Percent of this line item covered by this payment
-
getBinName
public String getBinName()
Bin this line item payment was for
-
getRefunded
public Boolean getRefunded()
Payment has been refunded
-
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
-
isNotNullId
public boolean isNotNullId()
Checks whether the 'id' field is set and is not null
-
isNotNullPercentage
public boolean isNotNullPercentage()
Checks whether the 'percentage' field is set and is not null
-
isNotNullBinName
public boolean isNotNullBinName()
Checks whether the 'binName' field is set and is not null
-
isNotNullRefunded
public boolean isNotNullRefunded()
Checks whether the 'refunded' field is set and is not null
-
hasId
public boolean hasId()
Checks whether the 'id' field has been set, however the value could be null
-
hasPercentage
public boolean hasPercentage()
Checks whether the 'percentage' field has been set, however the value could be null
-
hasBinName
public boolean hasBinName()
Checks whether the 'binName' field has been set, however the value could be null
-
hasRefunded
public boolean hasRefunded()
Checks whether the 'refunded' field has been set, however the value could be null
-
setId
public LineItemPayment setId(String id)
Sets the field 'id'.
-
setPercentage
public LineItemPayment setPercentage(Long percentage)
Sets the field 'percentage'.
-
setBinName
public LineItemPayment setBinName(String binName)
Sets the field 'binName'.
-
setRefunded
public LineItemPayment setRefunded(Boolean refunded)
Sets the field 'refunded'.
-
clearId
public void clearId()
Clears the 'id' field, the 'has' method for this field will now return false
-
clearPercentage
public void clearPercentage()
Clears the 'percentage' field, the 'has' method for this field will now return false
-
clearBinName
public void clearBinName()
Clears the 'binName' field, the 'has' method for this field will now return false
-
clearRefunded
public void clearRefunded()
Clears the 'refunded' 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 LineItemPayment copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(LineItemPayment src)
Copy all the changed fields from the given source to this instance.
-
-