Class AuthResultAccumulator
java.lang.Object
org.apache.juneau.rest.server.auth.AuthResultAccumulator
Mutable helper that folds a sequence of
AuthResults into a single result, honoring
AuthResult.MergeMode.
ADD keeps the first non-Principal.getName(), null-safe). A later result with a different non-REPLACE resets the accumulated principal + roles. Used by both
AuthFilterChain and the resource-level fold in RestContext.
See Also:
- Since:
- 10.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(AuthResult r) Folds the next result into this accumulator.result()Returns the folded result.
-
Constructor Details
-
AuthResultAccumulator
public AuthResultAccumulator()
-
-
Method Details
-
add
Folds the next result into this accumulator.- Parameters:
r- The result to fold in.null is ignored.- Returns:
- This object.
-
result
Returns the folded result.- Returns:
- The folded result, or
Optional.empty()if nothing was added or no principal was ever resolved.
-