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 in Set this type also implements Jsonifiable 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 Detail

      • newInstance

        static Permissions newInstance​(String permission,
                                       String... furtherPermissions)
        Returns a new immutable instance of Permissions 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 is null.
      • none

        static Permissions none()
        Returns a new immutable instance of Permissions 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 interface org.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 is true 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 is null.
      • contains

        boolean contains​(Permissions permissions)
        Indicates whether this set of permissions contains the specified permission(s). The result is true 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 is null.