001package org.hl7.fhir.r4.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum AssertResponseCodeTypes { 041 042 /** 043 * Response code is 200. 044 */ 045 OKAY, 046 /** 047 * Response code is 201. 048 */ 049 CREATED, 050 /** 051 * Response code is 204. 052 */ 053 NOCONTENT, 054 /** 055 * Response code is 304. 056 */ 057 NOTMODIFIED, 058 /** 059 * Response code is 400. 060 */ 061 BAD, 062 /** 063 * Response code is 403. 064 */ 065 FORBIDDEN, 066 /** 067 * Response code is 404. 068 */ 069 NOTFOUND, 070 /** 071 * Response code is 405. 072 */ 073 METHODNOTALLOWED, 074 /** 075 * Response code is 409. 076 */ 077 CONFLICT, 078 /** 079 * Response code is 410. 080 */ 081 GONE, 082 /** 083 * Response code is 412. 084 */ 085 PRECONDITIONFAILED, 086 /** 087 * Response code is 422. 088 */ 089 UNPROCESSABLE, 090 /** 091 * added to help the parsers 092 */ 093 NULL; 094 public static AssertResponseCodeTypes fromCode(String codeString) throws FHIRException { 095 if (codeString == null || "".equals(codeString)) 096 return null; 097 if ("okay".equals(codeString)) 098 return OKAY; 099 if ("created".equals(codeString)) 100 return CREATED; 101 if ("noContent".equals(codeString)) 102 return NOCONTENT; 103 if ("notModified".equals(codeString)) 104 return NOTMODIFIED; 105 if ("bad".equals(codeString)) 106 return BAD; 107 if ("forbidden".equals(codeString)) 108 return FORBIDDEN; 109 if ("notFound".equals(codeString)) 110 return NOTFOUND; 111 if ("methodNotAllowed".equals(codeString)) 112 return METHODNOTALLOWED; 113 if ("conflict".equals(codeString)) 114 return CONFLICT; 115 if ("gone".equals(codeString)) 116 return GONE; 117 if ("preconditionFailed".equals(codeString)) 118 return PRECONDITIONFAILED; 119 if ("unprocessable".equals(codeString)) 120 return UNPROCESSABLE; 121 throw new FHIRException("Unknown AssertResponseCodeTypes code '"+codeString+"'"); 122 } 123 public String toCode() { 124 switch (this) { 125 case OKAY: return "okay"; 126 case CREATED: return "created"; 127 case NOCONTENT: return "noContent"; 128 case NOTMODIFIED: return "notModified"; 129 case BAD: return "bad"; 130 case FORBIDDEN: return "forbidden"; 131 case NOTFOUND: return "notFound"; 132 case METHODNOTALLOWED: return "methodNotAllowed"; 133 case CONFLICT: return "conflict"; 134 case GONE: return "gone"; 135 case PRECONDITIONFAILED: return "preconditionFailed"; 136 case UNPROCESSABLE: return "unprocessable"; 137 default: return "?"; 138 } 139 } 140 public String getSystem() { 141 return "http://hl7.org/fhir/assert-response-code-types"; 142 } 143 public String getDefinition() { 144 switch (this) { 145 case OKAY: return "Response code is 200."; 146 case CREATED: return "Response code is 201."; 147 case NOCONTENT: return "Response code is 204."; 148 case NOTMODIFIED: return "Response code is 304."; 149 case BAD: return "Response code is 400."; 150 case FORBIDDEN: return "Response code is 403."; 151 case NOTFOUND: return "Response code is 404."; 152 case METHODNOTALLOWED: return "Response code is 405."; 153 case CONFLICT: return "Response code is 409."; 154 case GONE: return "Response code is 410."; 155 case PRECONDITIONFAILED: return "Response code is 412."; 156 case UNPROCESSABLE: return "Response code is 422."; 157 default: return "?"; 158 } 159 } 160 public String getDisplay() { 161 switch (this) { 162 case OKAY: return "okay"; 163 case CREATED: return "created"; 164 case NOCONTENT: return "noContent"; 165 case NOTMODIFIED: return "notModified"; 166 case BAD: return "bad"; 167 case FORBIDDEN: return "forbidden"; 168 case NOTFOUND: return "notFound"; 169 case METHODNOTALLOWED: return "methodNotAllowed"; 170 case CONFLICT: return "conflict"; 171 case GONE: return "gone"; 172 case PRECONDITIONFAILED: return "preconditionFailed"; 173 case UNPROCESSABLE: return "unprocessable"; 174 default: return "?"; 175 } 176 } 177 178 179}