class AbstractRestAuthCallbackHandler implements RestAuthCallbackHandler<T> {

    final void validateCallbackType(String callbackName, JsonValue jsonCallback) throws RestAuthException {
        String type = jsonCallback.get("type").asString();
        if (!callbackName.equalsIgnoreCase(type)) {
            DEBUG.message(MessageFormat.format("Method called with invalid callback, {0}.", type));
            throw new RestAuthException(ResourceException.BAD_REQUEST,
                    MessageFormat.format("Invalid Callback, {0}, for handler", type));
        }
    }

}