public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "ChallengeName": return Optional.ofNullable(clazz.cast(challengeNameAsString())); case "Session": return Optional.ofNullable(clazz.cast(session())); case "ChallengeParameters": return Optional.ofNullable(clazz.cast(challengeParameters())); case "AuthenticationResult": return Optional.ofNullable(clazz.cast(authenticationResult())); default: return Optional.empty(); } }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public String toString() { return ToString.builder("InitiateAuthResponse").add("ChallengeName", challengeNameAsString()).add("Session", session()) .add("ChallengeParameters", challengeParameters()).add("AuthenticationResult", authenticationResult()).build(); }
@Override public String toString() { return ToString.builder("InitiateAuthResponse").add("ChallengeName", challengeNameAsString()).add("Session", session()) .add("ChallengeParameters", challengeParameters()).add("AuthenticationResult", authenticationResult()).build(); }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "ChallengeName": return Optional.ofNullable(clazz.cast(challengeNameAsString())); case "Session": return Optional.ofNullable(clazz.cast(session())); case "ChallengeParameters": return Optional.ofNullable(clazz.cast(challengeParameters())); case "AuthenticationResult": return Optional.ofNullable(clazz.cast(authenticationResult())); default: return Optional.empty(); } }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(challengeNameAsString()); hashCode = 31 * hashCode + Objects.hashCode(session()); hashCode = 31 * hashCode + Objects.hashCode(challengeParameters()); hashCode = 31 * hashCode + Objects.hashCode(authenticationResult()); return hashCode; }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(challengeNameAsString()); hashCode = 31 * hashCode + Objects.hashCode(session()); hashCode = 31 * hashCode + Objects.hashCode(challengeParameters()); hashCode = 31 * hashCode + Objects.hashCode(authenticationResult()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof InitiateAuthResponse)) { return false; } InitiateAuthResponse other = (InitiateAuthResponse) obj; return Objects.equals(challengeNameAsString(), other.challengeNameAsString()) && Objects.equals(session(), other.session()) && Objects.equals(challengeParameters(), other.challengeParameters()) && Objects.equals(authenticationResult(), other.authenticationResult()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof InitiateAuthResponse)) { return false; } InitiateAuthResponse other = (InitiateAuthResponse) obj; return Objects.equals(challengeNameAsString(), other.challengeNameAsString()) && Objects.equals(session(), other.session()) && Objects.equals(challengeParameters(), other.challengeParameters()) && Objects.equals(authenticationResult(), other.authenticationResult()); }