Fields.java 992 Bytes
package pl.itcrowd.youtrack.api.defaults;

import pl.itcrowd.youtrack.api.Commander;

public enum Fields implements Commander {
    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;
    }
}