public class Permissions extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
Permissions.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
AUTHORITY |
static Parcelable.Creator<Permissions> |
CREATOR |
static JSONifiable.Creator<Permissions> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Permissions()
Constructs a new empty instance.
|
protected |
Permissions(boolean noInit)
Constructs a new empty instance.
|
|
Permissions(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.
|
|
Permissions(Permissions src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Permissions(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearBits()
Clears the 'bits' field, the 'has' method for this field will now return false
|
void |
clearId()
Clears the 'id' field, the 'has' method for this field will now return false
|
void |
clearReadablePermissions()
Clears the 'readablePermissions' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Permissions |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getBits()
A bitmap representing the permissions
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
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<Permission> |
getReadablePermissions()
A readable list of permissions
|
boolean |
hasBits()
Checks whether the 'bits' field has been set, however the value could be null
|
boolean |
hasId()
Checks whether the 'id' field has been set, however the value could be null
|
boolean |
hasReadablePermissions()
Checks whether the 'readablePermissions' field has been set, however the value could be null
|
boolean |
isNotEmptyReadablePermissions()
Checks whether the 'readablePermissions' field is set and is not null and is not empty
|
boolean |
isNotNullBits()
Checks whether the 'bits' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullReadablePermissions()
Checks whether the 'readablePermissions' field is set and is not null
|
void |
mergeChanges(Permissions 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.
|
Permissions |
setBits(Long bits)
Sets the field 'bits'.
|
Permissions |
setId(String id)
Sets the field 'id'.
|
Permissions |
setReadablePermissions(List<Permission> readablePermissions)
Sets the field 'readablePermissions'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final String AUTHORITY
public static final Parcelable.Creator<Permissions> CREATOR
public static final JSONifiable.Creator<Permissions> JSON_CREATOR
public Permissions()
protected Permissions(boolean noInit)
public Permissions(String json) throws IllegalArgumentException
IllegalArgumentException
public Permissions(JSONObject jsonObject)
public Permissions(Permissions src)
public String getId()
public Long getBits()
public List<Permission> getReadablePermissions()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullBits()
public boolean isNotNullReadablePermissions()
public boolean isNotEmptyReadablePermissions()
public boolean hasId()
public boolean hasBits()
public boolean hasReadablePermissions()
public Permissions setId(String id)
public Permissions setBits(Long bits)
public Permissions setReadablePermissions(List<Permission> readablePermissions)
public void clearId()
public void clearBits()
public void clearReadablePermissions()
public boolean containsChanges()
public void resetChangeLog()
public Permissions copyChanges()
public void mergeChanges(Permissions src)