/*******************************************************************************
 * 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 Characteristic Type is,<br>
 *  	INFERRED_RELATIONSHIP - refers to SNOMED CT Concept id for Inferred Relationship the SNOMED CT Component metadata hierarchy<br>
 * 		ADDITIONAL_RELATIONSHIP - refers to SNOMED CT Concept id for Additional Relationship<br>
 * 		STATED_RELATIONSHIP - refers to SNOMED CT Concept id for Stated Relationship<br>
 * 		QUALIFYING_RELATIONSHIP - refers to SNOMED CT Concept id for Qualifying Relationship<br>
 * 		DEFINING_RELATIONSHIP - refers to SNOMED CT Concept id for Defining Relationship<br>
 */
public enum EnumCharacteristicType implements Serializable{
	INFERRED_RELATIONSHIP("900000000000011006"),
	ADDITIONAL_RELATIONSHIP("900000000000227009"),
	STATED_RELATIONSHIP("900000000000010007"),
	QUALIFYING_RELATIONSHIP("900000000000225001"),
	DEFINING_RELATIONSHIP("900000000000006009");
	
	private static final Map<String, EnumCharacteristicType> lookup = new ConcurrentHashMap<String, EnumCharacteristicType>();
    static 
    {
        for (EnumCharacteristicType d : EnumCharacteristicType.values())
            lookup.put(d.getValue(), d);
    }
    	
	private String value;
	private EnumCharacteristicType( String value) {
		this.setValue(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 EnumCharacteristicType} enumeration for given string value
	 */
	public static EnumCharacteristicType getEnum(String val) 
	{
		return lookup.get(val);
	}
}
