1919
2020package org .apache .cloudstack .storage .feign .model ;
2121
22+ import com .fasterxml .jackson .annotation .JsonCreator ;
2223import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
2324import com .fasterxml .jackson .annotation .JsonInclude ;
2425import com .fasterxml .jackson .annotation .JsonProperty ;
26+ import com .fasterxml .jackson .annotation .JsonValue ;
2527
2628import java .util .List ;
2729import java .util .Objects ;
@@ -71,6 +73,7 @@ public enum OsTypeEnum {
7173 this .value = value ;
7274 }
7375
76+ @ JsonValue
7477 public String getValue () {
7578 return value ;
7679 }
@@ -80,9 +83,11 @@ public String toString() {
8083 return String .valueOf (value );
8184 }
8285
86+ @ JsonCreator
8387 public static OsTypeEnum fromValue (String text ) {
88+ if (text == null ) return null ;
8489 for (OsTypeEnum b : OsTypeEnum .values ()) {
85- if (String . valueOf (b .value ). equals ( text )) {
90+ if (text . equalsIgnoreCase (b .value )) {
8691 return b ;
8792 }
8893 }
@@ -122,6 +127,7 @@ public enum ProtocolEnum {
122127 this .value = value ;
123128 }
124129
130+ @ JsonValue
125131 public String getValue () {
126132 return value ;
127133 }
@@ -131,9 +137,11 @@ public String toString() {
131137 return String .valueOf (value );
132138 }
133139
140+ @ JsonCreator
134141 public static ProtocolEnum fromValue (String text ) {
142+ if (text == null ) return null ;
135143 for (ProtocolEnum b : ProtocolEnum .values ()) {
136- if (String . valueOf (b .value ). equals ( text )) {
144+ if (text . equalsIgnoreCase (b .value )) {
137145 return b ;
138146 }
139147 }
0 commit comments