Package org.eclipse.ditto.model.policies
Interface Permissions
-
- All Superinterfaces:
Collection<String>
,Iterable<String>
,org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonArray>
,Set<String>
public interface Permissions extends Set<String>, org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonArray>
This Set is dedicated to hold permissions only. Additionally to the methods defined inSet
this type also implementsJsonifiable
which means that a JSON representation can be obtained. This representation is a JSON array where the available permissions are either contained in the array or not.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable
org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends Object>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
contains(String permission, String... furtherPermissions)
Indicates whether this set of permissions contains the specified permission(s).boolean
contains(Permissions permissions)
Indicates whether this set of permissions contains the specified permission(s).default org.eclipse.ditto.model.base.json.JsonSchemaVersion[]
getSupportedSchemaVersions()
Permissions is only available in JsonSchemaVersion V_2.static Permissions
newInstance(String permission, String... furtherPermissions)
Returns a new immutable instance ofPermissions
containing the given permissions.static Permissions
none()
Returns a new immutable instance ofPermissions
containing no permissions.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Method Detail
-
newInstance
static Permissions newInstance(String permission, String... furtherPermissions)
Returns a new immutable instance ofPermissions
containing the given permissions.- Parameters:
permission
- the mandatory permission to be contained in the result.furtherPermissions
- additional permissions to be contained in the result.- Returns:
- the new
Permissions
. - Throws:
NullPointerException
- if any argument isnull
.
-
none
static Permissions none()
Returns a new immutable instance ofPermissions
containing no permissions.- Returns:
- the new
Permissions
.
-
getSupportedSchemaVersions
default org.eclipse.ditto.model.base.json.JsonSchemaVersion[] getSupportedSchemaVersions()
Permissions is only available in JsonSchemaVersion V_2.- Specified by:
getSupportedSchemaVersions
in interfaceorg.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonArray>
- Returns:
- the supported JsonSchemaVersions of Permissions.
-
contains
boolean contains(String permission, String... furtherPermissions)
Indicates whether this set of permissions contains the specified permission(s). The result istrue
if all specified permissions are contained in this set.- Parameters:
permission
- the permission whose presence in this set is to be tested.furtherPermissions
- additional permissions whose presence in this set is to be tested.- Returns:
true
if this set contains each specified permission,false
else.- Throws:
NullPointerException
- if any argument isnull
.
-
contains
boolean contains(Permissions permissions)
Indicates whether this set of permissions contains the specified permission(s). The result istrue
if all specified permissions are contained in this set.- Parameters:
permissions
- the permissions to be contained- Returns:
true
if this set contains each specified permission,false
else.- Throws:
NullPointerException
- if any argument isnull
.
-
-