Blame view

src/main/java/pl/itcrowd/youtrack/api/defaults/Fields.java 992 Bytes
bernard authored
1
package pl.itcrowd.youtrack.api.defaults;
bernard authored
2
bernard authored
3
import pl.itcrowd.youtrack.api.Commander;
bernard authored
4 5

public enum Fields implements Commander {
bernard authored
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    assignee,
    issueId("issue id"),
    state,
    created("created"),
    description,
    numberInProject(null),
    projectShortName("project"),
    reporterName("reporter"),
    resolved("resolved date"),
    summary,
    updated,
    updaterName("updated by");

// ------------------------------ FIELDS ------------------------------

    private String command;

// --------------------------- CONSTRUCTORS ---------------------------

    private Fields()
    {
        command = name();
    }

    private Fields(String command)
    {
        this.command = command;
    }

// --------------------- GETTER / SETTER METHODS ---------------------

    public String getCommand()
    {
        if (command == null) {
            throw new UnsupportedOperationException("There is no command for field: " + name());
        }
        return command;
    }
}