/*******************************************************************************
 * 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 modifier is<br>
 * UNIVERSAL_RESTRICTION- refers to the Concept id corresponding to Universal_Restriction from SNOMED CT Component metadata hierarchy<br>
 * EXISTENTIAL_RESTRICTION- refers to the Concept id corresponding to Existential_Restriction from SNOMED CT Component metadata hierarchy<br>
 */
public enum EnumModifier implements Serializable{
	UNIVERSAL_RESTRICTION("900000000000452009"),
	EXISTENTIAL_RESTRICTION("900000000000451002");
	
	private static final Map<String, EnumModifier> lookup = new ConcurrentHashMap<String, EnumModifier>();
    static 
    {
        for (EnumModifier d : EnumModifier.values())
            lookup.put(d.getValue(), d);
    }
    	
	private String value;
	
	private EnumModifier( 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 EnumModifier} enumeration for given string value
	 */
	public static EnumModifier getEnum(String val) 
	{
		return lookup.get(val);
	}
}
