Interface EvidenceDecoder

All Superinterfaces:
Function<org.wildfly.security.evidence.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<org.wildfly.security.evidence.Evidence, Principal>
A decoder for extracting a principal from evidence.
Since:
1.10.0
Author:
Farah Juma
  • Method Summary

    Modifier and Type
    Method
    Description
    Create an aggregated evidence decoder.
    default Principal
    apply(org.wildfly.security.evidence.Evidence evidence)
     
    getPrincipal(org.wildfly.security.evidence.Evidence evidence)
    Get the principal from the given evidence.

    Methods inherited from interface Function

    andThen, compose
  • Method Details

    • getPrincipal

      Principal getPrincipal(org.wildfly.security.evidence.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(org.wildfly.security.evidence.Evidence evidence)
      Specified by:
      apply in interface Function<org.wildfly.security.evidence.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