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

io.redskap.swagger.brake.cli.options.handler.NewApiPathHandler Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package io.redskap.swagger.brake.cli.options.handler;

import io.redskap.swagger.brake.cli.options.CliOptions;
import io.redskap.swagger.brake.runner.Options;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

@Component
class NewApiPathHandler implements CliOptionHandler {
    @Override
    public void handle(String propertyValue, Options options) {
        if (StringUtils.isBlank(propertyValue)) {
            throw new IllegalArgumentException(CliOptions.getAsCliOption(getHandledPropertyName()) + " must be set");
        }
        options.setNewApiPath(propertyValue);
    }

    @Override
    public String getHandledPropertyName() {
        return CliOptions.NEW_API_PATH;
    }

    @Override
    public String getHelpMessage() {
        return "The absolute path of the new api file";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy