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
Modifier and TypeMethodDescriptionclear()Clears the authorizations.booleanLogical check if the this object contains the given provider idforEach(String providerId, Consumer<Authorization> consumer) Walk all the authorizations for the given provider and call the consumer for each authorization.forEach(BiConsumer<String, Authorization> consumer) Walk all the authorizations and call the consumer for each authorization.booleanisEmpty()trueif the authorizations contains at least one provider.default Authorizationsput(String providerId, Authorization... authorizations) Replaces the current authorizations with the given authorizations for the given provider.put(String providerId, Set<Authorization> authorizations) Replaces the current authorizations with the given authorizations for the given provider.putAll(Map<String, Set<Authorization>> authorizations) Replaces the current authorizations with the given authorizations.booleanverify(Authorization resolvedAuthorization) Verifies that the given authorization is present in the authorizations.
-
Method Details
-
putAll
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
Replaces the current authorizations with the given authorizations for the given provider.- Parameters:
providerId- the provider.authorizations- the new map of authorizations.nullis equivalent to remove all authorizations for the given provider.- Returns:
- fluent self.
-
put
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()trueif the authorizations contains at least one provider. -
clear
Authorizations clear()Clears the authorizations. -
contains
Logical check if the this object contains the given provider id- Parameters:
providerId- the provider to search for.- Returns:
truewhen the provider is present.
-
verify
Verifies that the given authorization is present in the authorizations.- Parameters:
resolvedAuthorization- the authorization to verify.- Returns:
trueif the authorization is present.
-
forEach
Walk all the authorizations and call the consumer for each authorization.- Parameters:
consumer- the consumer to call.
-
forEach
Walk all the authorizations for the given provider and call the consumer for each authorization.- Parameters:
consumer- the consumer to call.
-