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 Details

    • 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

      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

      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.