Package org.eclipse.ditto.model.policies
Interface EffectedPermissions
-
- All Superinterfaces:
org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
,org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector
,org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>
,org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<org.eclipse.ditto.json.JsonObject>
,org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,org.eclipse.ditto.json.JsonField>
public interface EffectedPermissions extends org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>
HoldsPermissions
forPermissionEffect
s (grant/revoke).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
EffectedPermissions.JsonFields
An enumeration of the knownJsonField
s of a EffectedPermissions.-
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 default Permissions
getGrantedPermissions()
Returns the grantedPermissions
.Permissions
getPermissions(PermissionEffect effect)
Returns thePermissions
which are valid for the passedeffect
.default Permissions
getRevokedPermissions()
Returns the revokedPermissions
.default org.eclipse.ditto.model.base.json.JsonSchemaVersion[]
getSupportedSchemaVersions()
EffectedPermissions is only available in JsonSchemaVersion V_2.static EffectedPermissions
newInstance(Iterable<String> grantedPermissions, Iterable<String> revokedPermissions)
Returns a newEffectedPermissions
containing the givengrantedPermissions
andrevokedPermissions
.default org.eclipse.ditto.json.JsonObject
toJson()
Returns all non hidden marked fields of this EffectedPermissions.default org.eclipse.ditto.json.JsonObject
toJson(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion, org.eclipse.ditto.json.JsonFieldSelector fieldSelector)
-
Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable
getImplementedSchemaVersion, getLatestSchemaVersion, implementsSchemaVersion, implementsSchemaVersion, toJsonString
-
Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector
toJson, toJson, toJson, toJsonString, toJsonString
-
Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate
toJson, toJson, toJsonString, toJsonString
-
-
-
-
Method Detail
-
newInstance
static EffectedPermissions newInstance(@Nullable Iterable<String> grantedPermissions, @Nullable Iterable<String> revokedPermissions)
Returns a newEffectedPermissions
containing the givengrantedPermissions
andrevokedPermissions
.- Parameters:
grantedPermissions
- the Permissions which should be granted, may benull
.revokedPermissions
- the Permissions which should be revoked, may benull
.- Returns:
- the new
EffectedPermissions
.
-
getSupportedSchemaVersions
default org.eclipse.ditto.model.base.json.JsonSchemaVersion[] getSupportedSchemaVersions()
EffectedPermissions is only available in JsonSchemaVersion V_2.- Specified by:
getSupportedSchemaVersions
in interfaceorg.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
- Returns:
- the supported JsonSchemaVersions of EffectedPermissions.
-
getPermissions
Permissions getPermissions(PermissionEffect effect)
Returns thePermissions
which are valid for the passedeffect
.- Parameters:
effect
- the PermissionEffect for which to return the Permissions.- Returns:
- the Permissions which are valid for the passed effect.
- Throws:
NullPointerException
- ifeffect
isnull
.IllegalArgumentException
- ifeffect
is unknown.
-
getGrantedPermissions
default Permissions getGrantedPermissions()
Returns the grantedPermissions
.- Returns:
- the granted Permissions.
-
getRevokedPermissions
default Permissions getRevokedPermissions()
Returns the revokedPermissions
.- Returns:
- the revoked Permissions.
-
toJson
default org.eclipse.ditto.json.JsonObject toJson()
Returns all non hidden marked fields of this EffectedPermissions.- Specified by:
toJson
in interfaceorg.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
- Returns:
- a JSON object representation of this EffectedPermissions including only non hidden marked fields.
-
toJson
default org.eclipse.ditto.json.JsonObject toJson(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion, org.eclipse.ditto.json.JsonFieldSelector fieldSelector)
- Specified by:
toJson
in interfaceorg.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector
-
-