001package org.hl7.fhir.r4.model.codesystems; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 033 034import org.hl7.fhir.r4.model.EnumFactory; 035 036public class FHIRVersionEnumFactory implements EnumFactory<FHIRVersion> { 037 038 public FHIRVersion fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("0.01".equals(codeString)) 042 return FHIRVersion._0_01; 043 if ("0.05".equals(codeString)) 044 return FHIRVersion._0_05; 045 if ("0.06".equals(codeString)) 046 return FHIRVersion._0_06; 047 if ("0.11".equals(codeString)) 048 return FHIRVersion._0_11; 049 if ("0.0.80".equals(codeString)) 050 return FHIRVersion._0_0_80; 051 if ("0.0.81".equals(codeString)) 052 return FHIRVersion._0_0_81; 053 if ("0.0.82".equals(codeString)) 054 return FHIRVersion._0_0_82; 055 if ("0.4.0".equals(codeString)) 056 return FHIRVersion._0_4_0; 057 if ("0.5.0".equals(codeString)) 058 return FHIRVersion._0_5_0; 059 if ("1.0.0".equals(codeString)) 060 return FHIRVersion._1_0_0; 061 if ("1.0.1".equals(codeString)) 062 return FHIRVersion._1_0_1; 063 if ("1.0.2".equals(codeString)) 064 return FHIRVersion._1_0_2; 065 if ("1.1.0".equals(codeString)) 066 return FHIRVersion._1_1_0; 067 if ("1.4.0".equals(codeString)) 068 return FHIRVersion._1_4_0; 069 if ("1.6.0".equals(codeString)) 070 return FHIRVersion._1_6_0; 071 if ("1.8.0".equals(codeString)) 072 return FHIRVersion._1_8_0; 073 if ("3.0.0".equals(codeString)) 074 return FHIRVersion._3_0_0; 075 if ("3.0.1".equals(codeString)) 076 return FHIRVersion._3_0_1; 077 if ("3.3.0".equals(codeString)) 078 return FHIRVersion._3_3_0; 079 if ("3.5.0".equals(codeString)) 080 return FHIRVersion._3_5_0; 081 if ("4.0.0".equals(codeString)) 082 return FHIRVersion._4_0_0; 083 throw new IllegalArgumentException("Unknown FHIRVersion code '" + codeString + "'"); 084 } 085 086 public String toCode(FHIRVersion code) { 087 if (code == FHIRVersion.NULL) 088 return null; 089 if (code == FHIRVersion._0_01) 090 return "0.01"; 091 if (code == FHIRVersion._0_05) 092 return "0.05"; 093 if (code == FHIRVersion._0_06) 094 return "0.06"; 095 if (code == FHIRVersion._0_11) 096 return "0.11"; 097 if (code == FHIRVersion._0_0_80) 098 return "0.0.80"; 099 if (code == FHIRVersion._0_0_81) 100 return "0.0.81"; 101 if (code == FHIRVersion._0_0_82) 102 return "0.0.82"; 103 if (code == FHIRVersion._0_4_0) 104 return "0.4.0"; 105 if (code == FHIRVersion._0_5_0) 106 return "0.5.0"; 107 if (code == FHIRVersion._1_0_0) 108 return "1.0.0"; 109 if (code == FHIRVersion._1_0_1) 110 return "1.0.1"; 111 if (code == FHIRVersion._1_0_2) 112 return "1.0.2"; 113 if (code == FHIRVersion._1_1_0) 114 return "1.1.0"; 115 if (code == FHIRVersion._1_4_0) 116 return "1.4.0"; 117 if (code == FHIRVersion._1_6_0) 118 return "1.6.0"; 119 if (code == FHIRVersion._1_8_0) 120 return "1.8.0"; 121 if (code == FHIRVersion._3_0_0) 122 return "3.0.0"; 123 if (code == FHIRVersion._3_0_1) 124 return "3.0.1"; 125 if (code == FHIRVersion._3_3_0) 126 return "3.3.0"; 127 if (code == FHIRVersion._3_5_0) 128 return "3.5.0"; 129 if (code == FHIRVersion._4_0_0) 130 return "4.0.0"; 131 return "?"; 132 } 133 134 public String toSystem(FHIRVersion code) { 135 return code.getSystem(); 136 } 137 138}