Package io.vertx.ext.auth.authorization

## Interface Authorizations

-     public interface Authorizations

  Represents a cache map of authorizations per provider. Authorizations are immutable and can be shared between users.
  Author:
    Stephane Bastian

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Authorizations` | `clear()` | Clears the authorizations.
    `boolean` | `contains​(String providerId)` | Logical check if the this object contains the given provider id
    `Authorizations` | `forEach​(String providerId, Consumer<Authorization> consumer)` | Walk all the authorizations for the given provider and call the consumer for each authorization.
    `Authorizations` | `forEach​(BiConsumer<String,​Authorization> consumer)` | Walk all the authorizations and call the consumer for each authorization.
    `boolean` | `isEmpty()` | `true` if the authorizations contains at least one provider.
    `default Authorizations` | `put​(String providerId, Authorization... authorizations)` | Replaces the current authorizations with the given authorizations for the given provider.
    `Authorizations` | `put​(String providerId, Set<Authorization> authorizations)` | Replaces the current authorizations with the given authorizations for the given provider.
    `Authorizations` | `putAll​(Map<String,​Set<Authorization>> authorizations)` | Replaces the current authorizations with the given authorizations.
    `boolean` | `verify​(Authorization resolvedAuthorization)` | Verifies that the given authorization is present in the authorizations.

- - ### Method Detail

    - #### putAll

          Authorizations putAll​(Map<String,​Set<Authorization>> authorizations)

      Replaces the current authorizations with the given authorizations. The map is expected to be immutable.
      Parameters:
        `authorizations` - the new map of authorizations.
      Returns:
        fluent self.

    - #### put

          Authorizations put​(String providerId,
                             Set<Authorization> authorizations)

      Replaces the current authorizations with the given authorizations for the given provider.
      Parameters:
        `providerId` - the provider.
        `authorizations` - the new map of authorizations. `null` is equivalent to remove all authorizations for the given provider.
      Returns:
        fluent self.

    - #### put

          default Authorizations put​(String providerId,
                                     Authorization... authorizations)

      Replaces the current authorizations with the given authorizations for the given provider.
      Parameters:
        `providerId` - the provider.
        `authorizations` - the new array of authorizations.
      Returns:
        fluent self.

    - #### isEmpty

          boolean isEmpty()

      `true` if the authorizations contains at least one provider.

    - #### clear

          Authorizations clear()

      Clears the authorizations.

    - #### contains

          boolean contains​(String providerId)

      Logical check if the this object contains the given provider id
      Parameters:
        `providerId` - the provider to search for.
      Returns:
        `true` when the provider is present.

    - #### verify

          boolean verify​(Authorization resolvedAuthorization)

      Verifies that the given authorization is present in the authorizations.
      Parameters:
        `resolvedAuthorization` - the authorization to verify.
      Returns:
        `true` if the authorization is present.

    - #### forEach

          Authorizations forEach​(BiConsumer<String,​Authorization> consumer)

      Walk all the authorizations and call the consumer for each authorization.
      Parameters:
        `consumer` - the consumer to call.

    - #### forEach

          Authorizations forEach​(String providerId,
                                 Consumer<Authorization> consumer)

      Walk all the authorizations for the given provider and call the consumer for each authorization.
      Parameters:
        `consumer` - the consumer to call.