Subversion Repositories XServices

Rev

Rev 30 | 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;

/**
 * Static DBFieldnames for SBM/ TeamTrack system fields
 * which are not intended to be changed by a user directly
 * (auto-resolved by the system).
 * 
 * @author Brian Rosenberger
 */
public enum SBMStaticFields {
        
        /** The internal item id in [tableid:recordid] format. */
        ID("ID"),
        
        /** The internal uuid. */
        UUID("UUID"),
        
        /** The Constant ISSUEID. */
        ISSUEID("ISSUEID"),
        
        /** The project name (integer in DB, but name here).
         * because this is driven by the sbm web service */
        PROJECTID("PROJECTID"),
        
        /** The project uuid (not found in primary table). */
        PROJECTUUID("PROJECTUUID"),
        
        /** The submitter (id reference, but user login name here). */
        SUBMITTER("SUBMITTER"),
        
        /** The submit date/time. */
        SUBMITDATE("SUBMITDATE"),

        /** The LASTMODIFIEDDATE date/time. */
        LASTMODIFIEDDATE("LASTMODIFIEDDATE"),
        
        /** The LASTMODIFIER. */
        LASTMODIFIER("LASTMODIFIER"),

        /** The ACTIVEINACTIVE flag.*/
        ACTIVEINACTIVE("ACTIVEINACTIVE"),
        
        /** The Constant STATE. */
        STATE("STATE"),
        
        /** The ITEMURL (not present in DB) */
        ITEMURL("ITEMURL"),
        
        /** The owner of an item (id reference, but name here). */
        OWNER("OWNER"),
        
        /** The LASTSTATECHANGEDATE. */
        LASTSTATECHANGEDATE("LASTSTATECHANGEDATE"),
        
        /** The LASTSTATECHANGER (id reference, but name here). */
        LASTSTATECHANGER("LASTSTATECHANGER"),
        
        /** The SECONDARYOWNER (id reference, but name here). */
        SECONDARYOWNER("SECONDARYOWNER"),
        
        /** The CLOSEDATE. */
        CLOSEDATE("CLOSEDATE");
        
        private final String value;

    SBMStaticFields(String v) {
        value = v;
    }
    
    public String getValue() {
        return value;
    }

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