Package com.clover.sdk.v3.payments
Class VasSettings
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.payments.VasSettings
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class VasSettings extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
VasSettings.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<VasSettings>
CREATOR
static JSONifiable.Creator<VasSettings>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description VasSettings()
Constructs a new empty instance.protected
VasSettings(boolean noInit)
Constructs a new empty instance.VasSettings(VasSettings src)
Constructs a new instance that is a deep copy of the source instance.VasSettings(String json)
Constructs a new instance from the given JSON String.VasSettings(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
clearExtras()
Clears the 'extras' field, the 'has' method for this field will now return falsevoid
clearPushMode()
Clears the 'pushMode' field, the 'has' method for this field will now return falsevoid
clearServiceTypes()
Clears the 'serviceTypes' field, the 'has' method for this field will now return falsevoid
clearVasMode()
Clears the 'vasMode' field, the 'has' method for this field will now return falseboolean
containsChanges()
Returns true if this instance has any changes.VasSettings
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.Map<String,String>
getExtras()
Additional context relevant extras such as EXTRA_ORDER_IDprotected 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.VasPushMode
getPushMode()
Indicates if vas is push url only, no push, or push in addition to GETList<VasDataType>
getServiceTypes()
Vas service types of interest for this txnVasMode
getVasMode()
Populated per tx.boolean
hasExtras()
Checks whether the 'extras' field has been set, however the value could be nullboolean
hasPushMode()
Checks whether the 'pushMode' field has been set, however the value could be nullboolean
hasServiceTypes()
Checks whether the 'serviceTypes' field has been set, however the value could be nullboolean
hasVasMode()
Checks whether the 'vasMode' field has been set, however the value could be nullboolean
isNotEmptyExtras()
Checks whether the 'extras' field is set and is not null and is not emptyboolean
isNotEmptyServiceTypes()
Checks whether the 'serviceTypes' field is set and is not null and is not emptyboolean
isNotNullExtras()
Checks whether the 'extras' field is set and is not nullboolean
isNotNullPushMode()
Checks whether the 'pushMode' field is set and is not nullboolean
isNotNullServiceTypes()
Checks whether the 'serviceTypes' field is set and is not nullboolean
isNotNullVasMode()
Checks whether the 'vasMode' field is set and is not nullvoid
mergeChanges(VasSettings 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.VasSettings
setExtras(Map<String,String> extras)
Sets the field 'extras'.VasSettings
setPushMode(VasPushMode pushMode)
Sets the field 'pushMode'.VasSettings
setServiceTypes(List<VasDataType> serviceTypes)
Sets the field 'serviceTypes'.VasSettings
setVasMode(VasMode vasMode)
Sets the field 'vasMode'.void
validate()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<VasSettings> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<VasSettings> JSON_CREATOR
-
-
Constructor Detail
-
VasSettings
public VasSettings()
Constructs a new empty instance.
-
VasSettings
protected VasSettings(boolean noInit)
Constructs a new empty instance.
-
VasSettings
public VasSettings(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
VasSettings
public VasSettings(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.
-
VasSettings
public VasSettings(VasSettings src)
Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
-
-
Method Detail
-
getVasMode
public VasMode getVasMode()
Populated per tx. If not passed PAY_ONLY is the default behavior
-
getServiceTypes
public List<VasDataType> getServiceTypes()
Vas service types of interest for this txn
-
getExtras
public Map<String,String> getExtras()
Additional context relevant extras such as EXTRA_ORDER_ID
-
getPushMode
public VasPushMode getPushMode()
Indicates if vas is push url only, no push, or push in addition to GET
-
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
-
isNotNullVasMode
public boolean isNotNullVasMode()
Checks whether the 'vasMode' field is set and is not null
-
isNotNullServiceTypes
public boolean isNotNullServiceTypes()
Checks whether the 'serviceTypes' field is set and is not null
-
isNotEmptyServiceTypes
public boolean isNotEmptyServiceTypes()
Checks whether the 'serviceTypes' field is set and is not null and is not empty
-
isNotNullExtras
public boolean isNotNullExtras()
Checks whether the 'extras' field is set and is not null
-
isNotEmptyExtras
public boolean isNotEmptyExtras()
Checks whether the 'extras' field is set and is not null and is not empty
-
isNotNullPushMode
public boolean isNotNullPushMode()
Checks whether the 'pushMode' field is set and is not null
-
hasVasMode
public boolean hasVasMode()
Checks whether the 'vasMode' field has been set, however the value could be null
-
hasServiceTypes
public boolean hasServiceTypes()
Checks whether the 'serviceTypes' field has been set, however the value could be null
-
hasExtras
public boolean hasExtras()
Checks whether the 'extras' field has been set, however the value could be null
-
hasPushMode
public boolean hasPushMode()
Checks whether the 'pushMode' field has been set, however the value could be null
-
setVasMode
public VasSettings setVasMode(VasMode vasMode)
Sets the field 'vasMode'.
-
setServiceTypes
public VasSettings setServiceTypes(List<VasDataType> serviceTypes)
Sets the field 'serviceTypes'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
setExtras
public VasSettings setExtras(Map<String,String> extras)
Sets the field 'extras'.
-
setPushMode
public VasSettings setPushMode(VasPushMode pushMode)
Sets the field 'pushMode'.
-
clearVasMode
public void clearVasMode()
Clears the 'vasMode' field, the 'has' method for this field will now return false
-
clearServiceTypes
public void clearServiceTypes()
Clears the 'serviceTypes' field, the 'has' method for this field will now return false
-
clearExtras
public void clearExtras()
Clears the 'extras' field, the 'has' method for this field will now return false
-
clearPushMode
public void clearPushMode()
Clears the 'pushMode' 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 VasSettings copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(VasSettings src)
Copy all the changed fields from the given source to this instance.
-
-