/*******************************************************************************
 * Copyright 2014 Centre for Development of Advanced Computing(C-DAC), Pune
 * 
 * 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.
 ******************************************************************************/
package in.cdac.medinfo.csnotk.csnolib.commons;

import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
 * If description type is<br>
 * FULLY_SPECIFIED_NAME-refers to fully specified name(FSN) and returns the Concept id corresponding to FULLY_SPECIFIED_NAME from
 * SNOMED CT Component metadata hierarchy<br>
 * SYNONYM- refers to synonyms and returns the Concept id corresponding to SYNONYM from
 * SNOMED CT Component metadata hierarchy<br>
 * DEFINITION- refers to Definition and returns the Concept id corresponding to DEFINITION from
 * SNOMED CT Component metadata hierarchy<br>
 */
public enum EnumDescType implements Serializable{

	FULLY_SPECIFIED_NAME("900000000000003001"),
	SYNONYM("900000000000013009"),
	DEFINITION("900000000000550004");
	
	private static final Map<String, EnumDescType> lookup = new ConcurrentHashMap<String, EnumDescType>();
    static 
    {
        for (EnumDescType d : EnumDescType.values())
            lookup.put(d.getValue(), d);
    }
    	
	private String value;
	
	private EnumDescType(String value) {
		this.value = value;
	}
	
	/**
	 * Returns the value associated with enumeration.
	 * @return {@link String} value for enumeration.
	 */
	public String getValue() {
		return value;
	}
	
	/**
	 * Sets value for enumeration.
	 * @param value {@link String} value to be set.
	 */
	public void setValue(String value) {
		this.value = value;
	}
 
	/**
	 * Returns enumeration for given string value.
	 * @param val {@link String} value for which enumeration is to be retrieve.
	 * @return {@link EnumDescType} enumeration for given string value
	 */
	public static EnumDescType getEnum(String val) 
	{
		return lookup.get(val);
	}
}
