Package com.clover.sdk.v3.apps
Class AppMetered
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.apps.AppMetered
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class AppMetered extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AppMetered.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<AppMetered>
CREATOR
static JSONifiable.Creator<AppMetered>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description AppMetered()
Constructs a new empty instance.protected
AppMetered(boolean noInit)
Constructs a new empty instance.AppMetered(AppMetered src)
Constructs a new instance that is a deep copy of the source instance.AppMetered(String json)
Constructs a new instance from the given JSON String.AppMetered(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 Deprecated Methods Modifier and Type Method Description void
clearAction()
Clears the 'action' field, the 'has' method for this field will now return falsevoid
clearActive()
Clears the 'active' field, the 'has' method for this field will now return falsevoid
clearAmount()
Clears the 'amount' field, the 'has' method for this field will now return falsevoid
clearApp()
Clears the 'app' 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
clearLabel()
Clears the 'label' field, the 'has' method for this field will now return falsevoid
clearMeteredCountries()
Clears the 'meteredCountries' field, the 'has' method for this field will now return falseboolean
containsChanges()
Returns true if this instance has any changes.AppMetered
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.String
getAction()
Deprecated.Boolean
getActive()
Deprecated.Long
getAmount()
Deprecated.Reference
getApp()
Reference to the app this metered belongs toprotected GenericClient
getGenericClient()
String
getId()
Unique identifierJSONObject
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.String
getLabel()
A label used to identify this metered actionList<AppMeteredCountry>
getMeteredCountries()
Metered country options for this app meteredboolean
hasAction()
Checks whether the 'action' field has been set, however the value could be nullboolean
hasActive()
Checks whether the 'active' field has been set, however the value could be nullboolean
hasAmount()
Checks whether the 'amount' field has been set, however the value could be nullboolean
hasApp()
Checks whether the 'app' 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
hasLabel()
Checks whether the 'label' field has been set, however the value could be nullboolean
hasMeteredCountries()
Checks whether the 'meteredCountries' field has been set, however the value could be nullboolean
isNotEmptyMeteredCountries()
Checks whether the 'meteredCountries' field is set and is not null and is not emptyboolean
isNotNullAction()
Checks whether the 'action' field is set and is not nullboolean
isNotNullActive()
Checks whether the 'active' field is set and is not nullboolean
isNotNullAmount()
Checks whether the 'amount' field is set and is not nullboolean
isNotNullApp()
Checks whether the 'app' field is set and is not nullboolean
isNotNullId()
Checks whether the 'id' field is set and is not nullboolean
isNotNullLabel()
Checks whether the 'label' field is set and is not nullboolean
isNotNullMeteredCountries()
Checks whether the 'meteredCountries' field is set and is not nullvoid
mergeChanges(AppMetered 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.AppMetered
setAction(String action)
Sets the field 'action'.AppMetered
setActive(Boolean active)
Sets the field 'active'.AppMetered
setAmount(Long amount)
Sets the field 'amount'.AppMetered
setApp(Reference app)
Sets the field 'app'.AppMetered
setId(String id)
Sets the field 'id'.AppMetered
setLabel(String label)
Sets the field 'label'.AppMetered
setMeteredCountries(List<AppMeteredCountry> meteredCountries)
Sets the field 'meteredCountries'.void
validate()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<AppMetered> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<AppMetered> JSON_CREATOR
-
-
Constructor Detail
-
AppMetered
public AppMetered()
Constructs a new empty instance.
-
AppMetered
protected AppMetered(boolean noInit)
Constructs a new empty instance.
-
AppMetered
public AppMetered(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
AppMetered
public AppMetered(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.
-
AppMetered
public AppMetered(AppMetered 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
-
getAmount
@Deprecated public Long getAmount()
Deprecated.DEPRECATED: App metered amount. Instead use per country pricing in meteredCountries
-
getAction
@Deprecated public String getAction()
Deprecated.DEPRECATED: App metered action. Instead use per country pricing in meteredCountries
-
getActive
@Deprecated public Boolean getActive()
Deprecated.DEPRECATED: App metered active status. Instead use per country pricing in meteredCountries
-
getMeteredCountries
public List<AppMeteredCountry> getMeteredCountries()
Metered country options for this app metered
-
getApp
public Reference getApp()
Reference to the app this metered belongs to
-
getLabel
public String getLabel()
A label used to identify this metered action
-
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
-
isNotNullAmount
public boolean isNotNullAmount()
Checks whether the 'amount' field is set and is not null
-
isNotNullAction
public boolean isNotNullAction()
Checks whether the 'action' field is set and is not null
-
isNotNullActive
public boolean isNotNullActive()
Checks whether the 'active' field is set and is not null
-
isNotNullMeteredCountries
public boolean isNotNullMeteredCountries()
Checks whether the 'meteredCountries' field is set and is not null
-
isNotEmptyMeteredCountries
public boolean isNotEmptyMeteredCountries()
Checks whether the 'meteredCountries' field is set and is not null and is not empty
-
isNotNullApp
public boolean isNotNullApp()
Checks whether the 'app' field is set and is not null
-
isNotNullLabel
public boolean isNotNullLabel()
Checks whether the 'label' 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
-
hasAmount
public boolean hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
-
hasAction
public boolean hasAction()
Checks whether the 'action' field has been set, however the value could be null
-
hasActive
public boolean hasActive()
Checks whether the 'active' field has been set, however the value could be null
-
hasMeteredCountries
public boolean hasMeteredCountries()
Checks whether the 'meteredCountries' field has been set, however the value could be null
-
hasApp
public boolean hasApp()
Checks whether the 'app' field has been set, however the value could be null
-
hasLabel
public boolean hasLabel()
Checks whether the 'label' field has been set, however the value could be null
-
setId
public AppMetered setId(String id)
Sets the field 'id'.
-
setAmount
public AppMetered setAmount(Long amount)
Sets the field 'amount'.
-
setAction
public AppMetered setAction(String action)
Sets the field 'action'.
-
setActive
public AppMetered setActive(Boolean active)
Sets the field 'active'.
-
setMeteredCountries
public AppMetered setMeteredCountries(List<AppMeteredCountry> meteredCountries)
Sets the field 'meteredCountries'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
setApp
public AppMetered setApp(Reference app)
Sets the field 'app'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
-
setLabel
public AppMetered setLabel(String label)
Sets the field 'label'.
-
clearId
public void clearId()
Clears the 'id' 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
-
clearAction
public void clearAction()
Clears the 'action' field, the 'has' method for this field will now return false
-
clearActive
public void clearActive()
Clears the 'active' field, the 'has' method for this field will now return false
-
clearMeteredCountries
public void clearMeteredCountries()
Clears the 'meteredCountries' field, the 'has' method for this field will now return false
-
clearApp
public void clearApp()
Clears the 'app' field, the 'has' method for this field will now return false
-
clearLabel
public void clearLabel()
Clears the 'label' 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 AppMetered copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(AppMetered src)
Copy all the changed fields from the given source to this instance.
-
-