Class EvidenceDecodePrincipalCallback

    • Constructor Detail

      • EvidenceDecodePrincipalCallback

        public EvidenceDecodePrincipalCallback​(Evidence evidence)
        Construct a new instance of this Callback.
        Parameters:
        evidence - the evidence to be decoded
    • Method Detail

      • getEvidence

        public Evidence getEvidence()
        Get the evidence being decoded.
        Returns:
        the evidence being decoded
      • getEvidence

        public <C extends Evidence> C getEvidence​(Class<C> evidenceType)
        Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type.
        Type Parameters:
        C - the evidence type
        Parameters:
        evidenceType - the evidence type class (must not be null)
        Returns:
        the evidence, or null if the criteria wasn't met
      • getEvidence

        public <C extends Evidence> C getEvidence​(Class<C> evidenceType,
                                                  String algorithmName)
        Get the acquired evidence, if it is set and of the given type and algorithm, and if so, return the evidence cast to the type.
        Type Parameters:
        C - the evidence type
        Parameters:
        evidenceType - the evidence type class (must not be null)
        algorithmName - the algorithm name
        Returns:
        the evidence, or null if the criteria are not met
      • applyToEvidence

        public <C extends Evidence,​R> R applyToEvidence​(Class<C> evidenceType,
                                                              Function<C,​R> function)
        Apply the given function to the acquired evidence, if it is set and of the given type.
        Type Parameters:
        C - the evidence type
        R - the return type
        Parameters:
        evidenceType - the evidence type class (must not be null)
        function - the function to apply (must not be null)
        Returns:
        the result of the function, or null if the criteria are not met
      • applyToEvidence

        public <C extends Evidence,​R> R applyToEvidence​(Class<C> evidenceType,
                                                              String algorithmName,
                                                              Function<C,​R> function)
        Apply the given function to the acquired evidence, if it is set and of the given type and algorithm.
        Type Parameters:
        C - the evidence type
        R - the return type
        Parameters:
        evidenceType - the evidence type class (must not be null)
        algorithmName - the algorithm name
        function - the function to apply (must not be null)
        Returns:
        the result of the function, or null if the criteria are not met