001 002package ca.uhn.fhir.model.dstu2.valueset; 003 004import ca.uhn.fhir.model.api.*; 005import java.util.HashMap; 006import java.util.Map; 007 008public enum TypeRestfulInteractionEnum { 009 010 /** 011 * Code Value: <b>read</b> 012 */ 013 READ("read", "http://hl7.org/fhir/restful-interaction"), 014 015 /** 016 * Code Value: <b>vread</b> 017 */ 018 VREAD("vread", "http://hl7.org/fhir/restful-interaction"), 019 020 /** 021 * Code Value: <b>update</b> 022 */ 023 UPDATE("update", "http://hl7.org/fhir/restful-interaction"), 024 025 /** 026 * Code Value: <b>delete</b> 027 */ 028 DELETE("delete", "http://hl7.org/fhir/restful-interaction"), 029 030 /** 031 * Code Value: <b>history-instance</b> 032 */ 033 HISTORY_INSTANCE("history-instance", "http://hl7.org/fhir/restful-interaction"), 034 035 /** 036 * Code Value: <b>validate</b> 037 */ 038 VALIDATE("validate", "http://hl7.org/fhir/restful-interaction"), 039 040 /** 041 * Code Value: <b>history-type</b> 042 */ 043 HISTORY_TYPE("history-type", "http://hl7.org/fhir/restful-interaction"), 044 045 /** 046 * Code Value: <b>create</b> 047 */ 048 CREATE("create", "http://hl7.org/fhir/restful-interaction"), 049 050 /** 051 * Code Value: <b>search-type</b> 052 */ 053 SEARCH_TYPE("search-type", "http://hl7.org/fhir/restful-interaction"), 054 055 ; 056 057 /** 058 * Identifier for this Value Set: 059 * 060 */ 061 public static final String VALUESET_IDENTIFIER = ""; 062 063 /** 064 * Name for this Value Set: 065 * TypeRestfulInteraction 066 */ 067 public static final String VALUESET_NAME = "TypeRestfulInteraction"; 068 069 private static Map<String, TypeRestfulInteractionEnum> CODE_TO_ENUM = new HashMap<String, TypeRestfulInteractionEnum>(); 070 private static Map<String, Map<String, TypeRestfulInteractionEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, TypeRestfulInteractionEnum>>(); 071 072 private final String myCode; 073 private final String mySystem; 074 075 static { 076 for (TypeRestfulInteractionEnum next : TypeRestfulInteractionEnum.values()) { 077 CODE_TO_ENUM.put(next.getCode(), next); 078 079 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { 080 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, TypeRestfulInteractionEnum>()); 081 } 082 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); 083 } 084 } 085 086 /** 087 * Returns the code associated with this enumerated value 088 */ 089 public String getCode() { 090 return myCode; 091 } 092 093 /** 094 * Returns the code system associated with this enumerated value 095 */ 096 public String getSystem() { 097 return mySystem; 098 } 099 100 /** 101 * Returns the enumerated value associated with this code 102 */ 103 public static TypeRestfulInteractionEnum forCode(String theCode) { 104 TypeRestfulInteractionEnum retVal = CODE_TO_ENUM.get(theCode); 105 return retVal; 106 } 107 108 /** 109 * Converts codes to their respective enumerated values 110 */ 111 public static final IValueSetEnumBinder<TypeRestfulInteractionEnum> VALUESET_BINDER = new IValueSetEnumBinder<TypeRestfulInteractionEnum>() { 112 @Override 113 public String toCodeString(TypeRestfulInteractionEnum theEnum) { 114 return theEnum.getCode(); 115 } 116 117 @Override 118 public String toSystemString(TypeRestfulInteractionEnum theEnum) { 119 return theEnum.getSystem(); 120 } 121 122 @Override 123 public TypeRestfulInteractionEnum fromCodeString(String theCodeString) { 124 return CODE_TO_ENUM.get(theCodeString); 125 } 126 127 @Override 128 public TypeRestfulInteractionEnum fromCodeString(String theCodeString, String theSystemString) { 129 Map<String, TypeRestfulInteractionEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); 130 if (map == null) { 131 return null; 132 } 133 return map.get(theCodeString); 134 } 135 136 }; 137 138 /** 139 * Constructor 140 */ 141 TypeRestfulInteractionEnum(String theCode, String theSystem) { 142 myCode = theCode; 143 mySystem = theSystem; 144 } 145 146 147}