001
002package ca.uhn.fhir.rest.api;
003
004/*
005 * #%L
006 * HAPI FHIR - Core Library
007 * %%
008 * Copyright (C) 2014 - 2016 University Health Network
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the "License");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an "AS IS" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024import java.util.HashMap;
025import java.util.Map;
026
027import ca.uhn.fhir.util.CoverageIgnore;
028
029@CoverageIgnore
030public enum RestOperationTypeEnum {
031
032        ADD_TAGS("add-tags"),
033
034        DELETE_TAGS("delete-tags"),
035
036        GET_TAGS("get-tags"),
037
038        GET_PAGE("get-page"),
039
040        /**
041         * E.g. $everything, $validate, etc.
042         */
043        EXTENDED_OPERATION_SERVER("extended-operation-server"),
044
045        /**
046         * E.g. $everything, $validate, etc.
047         */
048        EXTENDED_OPERATION_TYPE("extended-operation-type"),
049
050        /**
051         * E.g. $everything, $validate, etc.
052         */
053        EXTENDED_OPERATION_INSTANCE("extended-operation-instance"),
054
055        /**
056         * Code Value: <b>create</b>
057         */
058        CREATE("create"),
059
060        /**
061         * Code Value: <b>delete</b>
062         */
063        DELETE("delete"),
064
065        /**
066         * Code Value: <b>history-instance</b>
067         */
068        HISTORY_INSTANCE("history-instance"),
069
070        /**
071         * Code Value: <b>history-system</b>
072         */
073        HISTORY_SYSTEM("history-system"),
074
075        /**
076         * Code Value: <b>history-type</b>
077         */
078        HISTORY_TYPE("history-type"),
079
080        /**
081         * Code Value: <b>read</b>
082         */
083        READ("read"),
084
085        /**
086         * Code Value: <b>search-system</b>
087         */
088        SEARCH_SYSTEM("search-system"),
089
090        /**
091         * Code Value: <b>search-type</b>
092         */
093        SEARCH_TYPE("search-type"),
094
095        /**
096         * Code Value: <b>transaction</b>
097         */
098        TRANSACTION("transaction"),
099
100        /**
101         * Code Value: <b>update</b>
102         */
103        UPDATE("update"),
104
105        /**
106         * Code Value: <b>validate</b>
107         */
108        VALIDATE("validate"),
109
110        /**
111         * Code Value: <b>vread</b>
112         */
113        VREAD("vread"),
114
115        /**
116         * Load the server's metadata
117         */
118        METADATA("metadata"), 
119        
120        /**
121         * $meta-add extended operation
122         */
123        META_ADD("$meta-add"),
124
125        /**
126         * $meta-add extended operation
127         */
128        META("$meta"),
129
130        /**
131         * $meta-delete extended operation
132         */
133        META_DELETE("$meta-delete"),
134
135        ;
136
137        private static Map<String, RestOperationTypeEnum> CODE_TO_ENUM = new HashMap<String, RestOperationTypeEnum>();
138
139        /**
140         * Identifier for this Value Set: http://hl7.org/fhir/vs/type-restful-operation
141         */
142        public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/type-restful-operation";
143
144        /**
145         * Name for this Value Set: RestfulOperationType
146         */
147        public static final String VALUESET_NAME = "RestfulOperationType";
148
149        static {
150                for (RestOperationTypeEnum next : RestOperationTypeEnum.values()) {
151                        CODE_TO_ENUM.put(next.getCode(), next);
152                }
153        }
154
155        private final String myCode;
156
157        /**
158         * Constructor
159         */
160        RestOperationTypeEnum(String theCode) {
161                myCode = theCode;
162        }
163
164        /**
165         * Returns the enumerated value associated with this code
166         */
167        public RestOperationTypeEnum forCode(String theCode) {
168                RestOperationTypeEnum retVal = CODE_TO_ENUM.get(theCode);
169                return retVal;
170        }
171
172        /**
173         * Returns the code associated with this enumerated value
174         */
175        public String getCode() {
176                return myCode;
177        }
178
179}