/** * Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type. * * @param evidenceType the evidence type class (must not be {@code null}) * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria wasn't met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType) { return applyToEvidence(evidenceType, Function.identity()); }
/** * 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. * * @param evidenceType the evidence type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria are not met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType, String algorithmName) { return applyToEvidence(evidenceType, algorithmName, Function.identity()); }
/** * Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type. * * @param evidenceType the evidence type class (must not be {@code null}) * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria wasn't met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType) { return applyToEvidence(evidenceType, Function.identity()); }
/** * 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. * * @param evidenceType the evidence type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria are not met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType, String algorithmName) { return applyToEvidence(evidenceType, algorithmName, Function.identity()); }
/** * 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. * * @param evidenceType the evidence type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria are not met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType, String algorithmName) { return applyToEvidence(evidenceType, algorithmName, Function.identity()); }
/** * Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type. * * @param evidenceType the evidence type class (must not be {@code null}) * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria wasn't met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType) { return applyToEvidence(evidenceType, Function.identity()); }
/** * 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. * * @param evidenceType the evidence type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria are not met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType, String algorithmName) { return applyToEvidence(evidenceType, algorithmName, Function.identity()); }
/** * Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type. * * @param evidenceType the evidence type class (must not be {@code null}) * @param <C> the evidence type * @return the evidence, or {@code null} if the criteria wasn't met */ public <C extends Evidence> C getEvidence(Class<C> evidenceType) { return applyToEvidence(evidenceType, Function.identity()); }
} else if (current instanceof EvidenceVerifyCallback) { EvidenceVerifyCallback vpc = (EvidenceVerifyCallback) current; vpc.setVerified(server.getAuthKey().equals(vpc.applyToEvidence(PasswordGuessEvidence.class, e -> new String(e.getGuess())))); } else if (current instanceof CredentialCallback) { CredentialCallback dhc = (CredentialCallback) current;
} else if (current instanceof EvidenceVerifyCallback) { EvidenceVerifyCallback vpc = (EvidenceVerifyCallback) current; vpc.setVerified(server.getAuthKey().equals(vpc.applyToEvidence(PasswordGuessEvidence.class, e -> new String(e.getGuess())))); } else if (current instanceof CredentialCallback) { CredentialCallback dhc = (CredentialCallback) current;