Subversion Repositories XServices

Rev

Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

/*
 *   Mylyn Connector for Serena Business Mashups
 *       Copyright 2010 Brian Rosenberger (Brutex Network)
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 * 
 *   Serena, TeamTrack and Serena Business Mashup are 
 *       registered trademarks of SERENA Software Inc.
 */
package net.brutex.mylyn.sbmconnector.core.model;

/**
 * System DBFieldnames for SBM/ TeamTrack.
 * 
 * @author Brian Rosenberger
 */
public enum SBMSystemFields {
        
        /** The internal item id in [tableid:recordid] format. */
        ID("ID", true),
        
        /** The internal uuid. */
        UUID("UUID", false),
        
        /** Whether the item is active or inactive in its current state */
        ACTIVEINACTIVE("ACTIVEINACTIVE", false),
        
        /** The date that the item was closed */
        CLOSEDATE("CLOSEDATE", true),
        
        /** Used for Partner Access to CRs They Submit */
        COMPANY("COMPANY", false),
        
        /** Used for Partner Access to CRs They Submit */
        CONTACT("CONTACT", false),
        
        /** Detailed information about the item */
         DESCRIPTION("DESCRIPTION", true),
         
         /** The displayed identifier of the item */
         ISSUEID("ISSUEID", true),
         
         /** The type of the item */
         ISSUETYPE("ISSUETYPE", true),
         
         /** The last time the item's data was changed */
         LASTMODIFIEDDATE("LASTMODIFIEDDATE", true),
         
         /** The last person to change the data in this item */
         LASTMODIFIER("LASTMODIFIER", true),
         
         /** The last time the state of this item was changed */
         LASTSTATECHANGEDATE("LASTSTATECHANGEDATE", false),
         
         /** The last person to change the state of this item */
         LASTSTATECHANGER("LASTSTATECHANGER", false),
         
         /** The primary person who currently owns the item */
         OWNER("OWNER", false),
         
         /** The project in which this item resides */
         PROJECTID("PROJECTID", false),
         
         /** Detailed information about the resolution */
         RESOLUTIONDESC("RESOLUTIONDESC", false),
         
         /** Summary description of the resolution */
         RESOLUTIONSUMMARY("RESOLUTIONSUMMARY", false),
         
         /** The secondary people who currently own the item */
         SECONDARYOWNER("SECONDARYOWNER", false),
         
         /** The current state of the item */
         STATE("STATE", true),
         
         /** The date that the item was created/submitted */
         SUBMITDATE("SUBMITDATE", true),
         
         /** The person who created/submitted the item */
         SUBMITTER("SUBMITTER", true),
         
         /** Summary description of the item */
         TITLE("TITLE", true); 
         
        
        private final String value;
        private final boolean hasTaskAttribute;

    SBMSystemFields(String v, boolean hasTaskAttribute) {
        value = v;
        this.hasTaskAttribute = hasTaskAttribute;
    }
    
    public String getValue() {
        return value;
    }
    
    public boolean hasTaskAttribute() {
        return this.hasTaskAttribute;
    }

    public static SBMSystemFields fromValue(String v) {
        for (SBMSystemFields c: SBMSystemFields.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }
}