2525import io .swagger .annotations .ApiModelProperty ;
2626import java .util .ArrayList ;
2727import java .util .List ;
28- import org .openapitools .jackson .nullable .JsonNullable ;
29- import com .fasterxml .jackson .annotation .JsonIgnore ;
30- import org .openapitools .jackson .nullable .JsonNullable ;
31- import java .util .NoSuchElementException ;
3228import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
3329import com .fasterxml .jackson .annotation .JsonTypeName ;
3430
@@ -55,7 +51,7 @@ public class Partition {
5551 private List <Node > isr = null ;
5652
5753 public static final String JSON_PROPERTY_LEADER = "leader" ;
58- private JsonNullable < Node > leader = JsonNullable .< Node > undefined () ;
54+ private Node leader ;
5955
6056 public Partition () {
6157 }
@@ -158,8 +154,8 @@ public void setIsr(List<Node> isr) {
158154
159155
160156 public Partition leader (Node leader ) {
161- this .leader = JsonNullable .<Node >of (leader );
162157
158+ this .leader = leader ;
163159 return this ;
164160 }
165161
@@ -169,26 +165,18 @@ public Partition leader(Node leader) {
169165 **/
170166 @ javax .annotation .Nullable
171167 @ ApiModelProperty (value = "" )
172- @ JsonIgnore
173-
174- public Node getLeader () {
175- return leader .orElse (null );
176- }
177-
178168 @ JsonProperty (JSON_PROPERTY_LEADER )
179169 @ JsonInclude (value = JsonInclude .Include .USE_DEFAULTS )
180170
181- public JsonNullable < Node > getLeader_JsonNullable () {
171+ public Node getLeader () {
182172 return leader ;
183173 }
184-
185- @ JsonProperty (JSON_PROPERTY_LEADER )
186- public void setLeader_JsonNullable (JsonNullable <Node > leader ) {
187- this .leader = leader ;
188- }
189174
175+
176+ @ JsonProperty (JSON_PROPERTY_LEADER )
177+ @ JsonInclude (value = JsonInclude .Include .USE_DEFAULTS )
190178 public void setLeader (Node leader ) {
191- this .leader = JsonNullable .< Node > of ( leader ) ;
179+ this .leader = leader ;
192180 }
193181
194182
@@ -204,23 +192,12 @@ public boolean equals(Object o) {
204192 return Objects .equals (this .partition , partition .partition ) &&
205193 Objects .equals (this .replicas , partition .replicas ) &&
206194 Objects .equals (this .isr , partition .isr ) &&
207- equalsNullable (this .leader , partition .leader );
208- }
209-
210- private static <T > boolean equalsNullable (JsonNullable <T > a , JsonNullable <T > b ) {
211- return a == b || (a != null && b != null && a .isPresent () && b .isPresent () && Objects .deepEquals (a .get (), b .get ()));
195+ Objects .equals (this .leader , partition .leader );
212196 }
213197
214198 @ Override
215199 public int hashCode () {
216- return Objects .hash (partition , replicas , isr , hashCodeNullable (leader ));
217- }
218-
219- private static <T > int hashCodeNullable (JsonNullable <T > a ) {
220- if (a == null ) {
221- return 1 ;
222- }
223- return a .isPresent () ? Arrays .deepHashCode (new Object []{a .get ()}) : 31 ;
200+ return Objects .hash (partition , replicas , isr , leader );
224201 }
225202
226203 @ Override
0 commit comments