public class SoftwarePackage extends GenericParcelable implements Validator, JSONifiable
A collection of APK and ROM versions that can be delivered to a merchant as a single package
Modifier and Type | Class and Description |
---|---|
static interface |
SoftwarePackage.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<SoftwarePackage> |
CREATOR |
static JSONifiable.Creator<SoftwarePackage> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
SoftwarePackage()
Constructs a new empty instance.
|
protected |
SoftwarePackage(boolean noInit)
Constructs a new empty instance.
|
|
SoftwarePackage(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.
|
|
SoftwarePackage(SoftwarePackage src)
Constructs a new instance that is a deep copy of the source instance.
|
|
SoftwarePackage(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAndroidVersions()
Clears the 'androidVersions' field, the 'has' method for this field will now return false
|
void |
clearRoms()
Clears the 'roms' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
SoftwarePackage |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
List<Reference> |
getAndroidVersions() |
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.
|
List<Reference> |
getRoms() |
boolean |
hasAndroidVersions()
Checks whether the 'androidVersions' field has been set, however the value could be null
|
boolean |
hasRoms()
Checks whether the 'roms' field has been set, however the value could be null
|
boolean |
isNotEmptyAndroidVersions()
Checks whether the 'androidVersions' field is set and is not null and is not empty
|
boolean |
isNotEmptyRoms()
Checks whether the 'roms' field is set and is not null and is not empty
|
boolean |
isNotNullAndroidVersions()
Checks whether the 'androidVersions' field is set and is not null
|
boolean |
isNotNullRoms()
Checks whether the 'roms' field is set and is not null
|
void |
mergeChanges(SoftwarePackage 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.
|
SoftwarePackage |
setAndroidVersions(List<Reference> androidVersions)
Sets the field 'androidVersions'.
|
SoftwarePackage |
setRoms(List<Reference> roms)
Sets the field 'roms'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<SoftwarePackage> CREATOR
public static final JSONifiable.Creator<SoftwarePackage> JSON_CREATOR
public SoftwarePackage()
protected SoftwarePackage(boolean noInit)
public SoftwarePackage(String json) throws IllegalArgumentException
IllegalArgumentException
public SoftwarePackage(JSONObject jsonObject)
public SoftwarePackage(SoftwarePackage src)
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullAndroidVersions()
public boolean isNotEmptyAndroidVersions()
public boolean isNotNullRoms()
public boolean isNotEmptyRoms()
public boolean hasAndroidVersions()
public boolean hasRoms()
public SoftwarePackage setAndroidVersions(List<Reference> androidVersions)
public SoftwarePackage setRoms(List<Reference> roms)
public void clearAndroidVersions()
public void clearRoms()
public boolean containsChanges()
public void resetChangeLog()
public SoftwarePackage copyChanges()
public void mergeChanges(SoftwarePackage src)