View Javadoc
1   package ca.uhn.fhir.rest.param;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import java.util.HashMap;
24  import java.util.Map;
25  
26  /**
27   * Modifiers for {@link TokenParam}
28   */
29  public enum TokenParamModifier {
30  	/** 
31  	 * :above
32  	 */
33  	ABOVE(":above"),
34  	
35  	/** 
36  	 * :above
37  	 */
38  	BELOW(":below"),
39  	
40  	/** 
41  	 * :in
42  	 */
43  	IN(":in"),
44  	
45  	/** 
46  	 * :not
47  	 */
48  	NOT(":not"),
49  	
50  	/** 
51  	 * :not-in
52  	 */
53  	NOT_IN(":not-in"),
54  	
55  	/** 
56  	 * :text
57  	 */
58  	TEXT(":text");
59  	
60  	private static final Map<String, TokenParamModifier> VALUE_TO_ENUM;
61  
62  	static {
63  		Map<String, TokenParamModifier> valueToEnum = new HashMap<String, TokenParamModifier>();
64  		for (TokenParamModifier next : values()) {
65  			valueToEnum.put(next.getValue(), next);
66  		}
67  		VALUE_TO_ENUM = valueToEnum;
68  	}
69  	private final String myValue;
70  
71  	private TokenParamModifier(String theValue) {
72  		myValue = theValue;
73  	}
74  	
75  	public String getValue() {
76  		return myValue;
77  	}
78  
79  	public static TokenParamModifier forValue(String theValue) {
80  		return VALUE_TO_ENUM.get(theValue);
81  	}
82  	
83  }