All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.auth0.jwt.exceptions.IncorrectClaimException Maven / Gradle / Ivy

There is a newer version: 4.4.0
Show newest version
package com.auth0.jwt.exceptions;

import com.auth0.jwt.interfaces.Claim;

/**
 * This exception is thrown when the expected value is not found while verifying the Claims.
 */
public class IncorrectClaimException extends InvalidClaimException {
    private final String claimName;

    private final Claim claimValue;

    /**
     * Used internally to construct the IncorrectClaimException which is thrown when there is verification
     * failure for a Claim that exists.
     *
     * @param message The error message
     * @param claimName The Claim name for which verification failed
     * @param claim The Claim value for which verification failed
     */
    public IncorrectClaimException(String message, String claimName, Claim claim) {
        super(message);
        this.claimName = claimName;
        this.claimValue = claim;
    }

    /**
     * This method can be used to fetch the name for which the Claim verification failed.
     *
     * @return The claim name for which the verification failed.
     */
    public String getClaimName() {
        return claimName;
    }

    /**
     * This method can be used to fetch the value for which the Claim verification failed.
     *
     * @return The value for which the verification failed
     */
    public Claim getClaimValue() {
        return claimValue;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy