Interface EvidenceDecoder

All Superinterfaces:
Function<Evidence,Principal>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EvidenceDecoder extends Function<Evidence,Principal>
A decoder for extracting a principal from evidence.
Since:
1.10.0
Author:
Farah Juma
  • Method Details

    • getPrincipal

      Principal getPrincipal(Evidence evidence)
      Get the principal from the given evidence. If this decoder does not understand the given evidence, null is returned.
      Parameters:
      evidence - the evidence to decode
      Returns:
      the principal, or null if this decoder does not understand the evidence
    • apply

      default Principal apply(Evidence evidence)
      Specified by:
      apply in interface Function<Evidence,Principal>
    • aggregate

      static EvidenceDecoder aggregate(EvidenceDecoder... decoders)
      Create an aggregated evidence decoder. The aggregated decoder will try each evidence decoder until one returns a non-null value. If all the evidence decoders return null, then null will be returned.
      Parameters:
      decoders - the constituent decoders
      Returns:
      the aggregated decoder