class RestAuthConfirmationCallbackHandler extends AbstractRestAuthCallbackHandler<ConfirmationCallback> {

    public JsonValue convertToJson(ConfirmationCallback callback, int index) {

        String prompt = callback.getPrompt();
        int messageType = callback.getMessageType();
        String[] options = callback.getOptions();
        int optionType = callback.getOptionType();
        int defaultOption = callback.getDefaultOption();
        int selectedIndex = callback.getSelectedIndex();

        JsonValue jsonValue = JsonValueBuilder.jsonValue()
                .put("type", CALLBACK_NAME)
                .array("output")
                .add(createOutputField("prompt", prompt))
                .add(createOutputField("messageType", messageType))
                .add(createOutputField("options", options))
                .add(createOutputField("optionType", optionType))
                .addLast(createOutputField("defaultOption", defaultOption))
                .array("input")
                .addLast(createInputField(index, selectedIndex))
                .build();

        return jsonValue;
    }

}