Class AuthResultAccumulator

java.lang.Object
org.apache.juneau.rest.server.auth.AuthResultAccumulator

public final class AuthResultAccumulator extends Object
Mutable helper that folds a sequence of AuthResults into a single result, honoring AuthResult.MergeMode.

ADD keeps the first non-null principal and unions roles from later results only when those results carry no principal of their own or the same principal (compared by Principal.getName(), null-safe). A later result with a different non-null principal does not contribute its roles — a second authenticated identity must not silently elevate the first. REPLACE resets the accumulated principal + roles. Used by both AuthFilterChain and the resource-level fold in RestContext.

See Also:
Since:
10.0.0