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

com.redhat.ceylon.common.tool.OptionModel Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
package com.redhat.ceylon.common.tool;

/**
 * A command line option or option argument accepted by a plugin
 */
public class OptionModel {
    public static enum ArgumentType {
        BOOLEAN,
        OPTIONAL,
        REQUIRED
    }
    private ToolModel toolModel;
    private String longName;
    private Character shortName;
    private ArgumentModel argument;
    private ArgumentType argumentType;
    
    public ToolModel getToolModel() {
        return toolModel;
    }
    public void setToolModel(ToolModel toolModel) {
        this.toolModel = toolModel;
    }
    public String getLongName() {
        return longName;
    }
    public void setLongName(String name) {
        this.longName = name;
    }
    public Character getShortName() {
        return shortName;
    }
    public void setShortName(Character shortName) {
        this.shortName = shortName;
    }
    public ArgumentModel getArgument() {
        return argument;
    }
    public void setArgument(ArgumentModel argument) {
        this.argument = argument;
    }
    public void setArgumentType(ArgumentType argumentType) {
        this.argumentType = argumentType;
    }
    public ArgumentType getArgumentType() {
        return this.argumentType;
    }
    public String toString() {
        StringBuilder sb = new StringBuilder();
        if (longName != null) {
            sb.append("--").append(longName);
        }
        if (longName != null && shortName != null) {
            sb.append("/");
        }
        if (shortName != null) {
            sb.append("-").append(shortName);
        }
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy