001// Automatically generated by the Thrifty compiler; do not edit!
002// Generated on: 2020-11-05T09:22:38.121Z
003// Source: J:\facelog\facelog-service\IFaceLog.thrift at 203:1
004package net.gdface.facelog.client.thrift;
005
006import com.microsoft.thrifty.Adapter;
007import com.microsoft.thrifty.Struct;
008import com.microsoft.thrifty.StructBuilder;
009import com.microsoft.thrifty.TType;
010import com.microsoft.thrifty.ThriftField;
011import com.microsoft.thrifty.protocol.FieldMetadata;
012import com.microsoft.thrifty.protocol.Protocol;
013import com.microsoft.thrifty.util.ProtocolUtil;
014import java.io.IOException;
015import javax.annotation.Generated;
016import okio.ByteString;
017
018@Generated(
019    value = "com.microsoft.thrifty.gen.ThriftyCodeGenerator",
020    comments = "https://github.com/microsoft/thrifty"
021)
022public final class PersonGroupBean implements Struct {
023  public static final Adapter<PersonGroupBean, Builder> ADAPTER = new PersonGroupBeanAdapter();
024
025  @ThriftField(
026      fieldId = 1,
027      isRequired = true
028  )
029  public final Boolean _new;
030
031  @ThriftField(
032      fieldId = 2,
033      isRequired = true
034  )
035  public final Integer modified;
036
037  @ThriftField(
038      fieldId = 3,
039      isRequired = true
040  )
041  public final Integer initialized;
042
043  @ThriftField(
044      fieldId = 4,
045      isOptional = true
046  )
047  public final Integer id;
048
049  @ThriftField(
050      fieldId = 5,
051      isOptional = true
052  )
053  public final String name;
054
055  @ThriftField(
056      fieldId = 6,
057      isOptional = true
058  )
059  public final Integer leaf;
060
061  @ThriftField(
062      fieldId = 7,
063      isOptional = true
064  )
065  public final Integer parent;
066
067  @ThriftField(
068      fieldId = 8,
069      isOptional = true
070  )
071  public final Integer rootGroup;
072
073  @ThriftField(
074      fieldId = 9,
075      isOptional = true
076  )
077  public final String remark;
078
079  @ThriftField(
080      fieldId = 10,
081      isOptional = true
082  )
083  public final ByteString extBin;
084
085  @ThriftField(
086      fieldId = 11,
087      isOptional = true
088  )
089  public final String extTxt;
090
091  @ThriftField(
092      fieldId = 12,
093      isOptional = true
094  )
095  public final Long createTime;
096
097  @ThriftField(
098      fieldId = 13,
099      isOptional = true
100  )
101  public final Long updateTime;
102
103  private PersonGroupBean(Builder builder) {
104    this._new = builder._new;
105    this.modified = builder.modified;
106    this.initialized = builder.initialized;
107    this.id = builder.id;
108    this.name = builder.name;
109    this.leaf = builder.leaf;
110    this.parent = builder.parent;
111    this.rootGroup = builder.rootGroup;
112    this.remark = builder.remark;
113    this.extBin = builder.extBin;
114    this.extTxt = builder.extTxt;
115    this.createTime = builder.createTime;
116    this.updateTime = builder.updateTime;
117  }
118
119  @Override
120  @SuppressWarnings({"NumberEquality", "StringEquality"})
121  public boolean equals(Object other) {
122    if (this == other) return true;
123    if (other == null) return false;
124    if (!(other instanceof PersonGroupBean)) return false;
125    PersonGroupBean that = (PersonGroupBean) other;
126    return (this._new == that._new || this._new.equals(that._new))
127        && (this.modified == that.modified || this.modified.equals(that.modified))
128        && (this.initialized == that.initialized || this.initialized.equals(that.initialized))
129        && (this.id == that.id || (this.id != null && this.id.equals(that.id)))
130        && (this.name == that.name || (this.name != null && this.name.equals(that.name)))
131        && (this.leaf == that.leaf || (this.leaf != null && this.leaf.equals(that.leaf)))
132        && (this.parent == that.parent || (this.parent != null && this.parent.equals(that.parent)))
133        && (this.rootGroup == that.rootGroup || (this.rootGroup != null && this.rootGroup.equals(that.rootGroup)))
134        && (this.remark == that.remark || (this.remark != null && this.remark.equals(that.remark)))
135        && (this.extBin == that.extBin || (this.extBin != null && this.extBin.equals(that.extBin)))
136        && (this.extTxt == that.extTxt || (this.extTxt != null && this.extTxt.equals(that.extTxt)))
137        && (this.createTime == that.createTime || (this.createTime != null && this.createTime.equals(that.createTime)))
138        && (this.updateTime == that.updateTime || (this.updateTime != null && this.updateTime.equals(that.updateTime)));
139  }
140
141  @Override
142  public int hashCode() {
143    int code = 16777619;
144    code ^= this._new.hashCode();
145    code *= 0x811c9dc5;
146    code ^= this.modified.hashCode();
147    code *= 0x811c9dc5;
148    code ^= this.initialized.hashCode();
149    code *= 0x811c9dc5;
150    code ^= (this.id == null) ? 0 : this.id.hashCode();
151    code *= 0x811c9dc5;
152    code ^= (this.name == null) ? 0 : this.name.hashCode();
153    code *= 0x811c9dc5;
154    code ^= (this.leaf == null) ? 0 : this.leaf.hashCode();
155    code *= 0x811c9dc5;
156    code ^= (this.parent == null) ? 0 : this.parent.hashCode();
157    code *= 0x811c9dc5;
158    code ^= (this.rootGroup == null) ? 0 : this.rootGroup.hashCode();
159    code *= 0x811c9dc5;
160    code ^= (this.remark == null) ? 0 : this.remark.hashCode();
161    code *= 0x811c9dc5;
162    code ^= (this.extBin == null) ? 0 : this.extBin.hashCode();
163    code *= 0x811c9dc5;
164    code ^= (this.extTxt == null) ? 0 : this.extTxt.hashCode();
165    code *= 0x811c9dc5;
166    code ^= (this.createTime == null) ? 0 : this.createTime.hashCode();
167    code *= 0x811c9dc5;
168    code ^= (this.updateTime == null) ? 0 : this.updateTime.hashCode();
169    code *= 0x811c9dc5;
170    return code;
171  }
172
173  @Override
174  public String toString() {
175    return "PersonGroupBean{_new=" + this._new + ", modified=" + this.modified + ", initialized=" + this.initialized + ", id=" + this.id + ", name=" + this.name + ", leaf=" + this.leaf + ", parent=" + this.parent + ", rootGroup=" + this.rootGroup + ", remark=" + this.remark + ", extBin=" + this.extBin + ", extTxt=" + this.extTxt + ", createTime=" + this.createTime + ", updateTime=" + this.updateTime + "}";
176  }
177
178  @Override
179  public void write(Protocol protocol) throws IOException {
180    ADAPTER.write(protocol, this);
181  }
182
183  public static final class Builder implements StructBuilder<PersonGroupBean> {
184    private Boolean _new;
185
186    private Integer modified;
187
188    private Integer initialized;
189
190    private Integer id;
191
192    private String name;
193
194    private Integer leaf;
195
196    private Integer parent;
197
198    private Integer rootGroup;
199
200    private String remark;
201
202    private ByteString extBin;
203
204    private String extTxt;
205
206    private Long createTime;
207
208    private Long updateTime;
209
210    public Builder() {
211    }
212
213    public Builder(PersonGroupBean struct) {
214      this._new = struct._new;
215      this.modified = struct.modified;
216      this.initialized = struct.initialized;
217      this.id = struct.id;
218      this.name = struct.name;
219      this.leaf = struct.leaf;
220      this.parent = struct.parent;
221      this.rootGroup = struct.rootGroup;
222      this.remark = struct.remark;
223      this.extBin = struct.extBin;
224      this.extTxt = struct.extTxt;
225      this.createTime = struct.createTime;
226      this.updateTime = struct.updateTime;
227    }
228
229    public Builder _new(Boolean _new) {
230      if (_new == null) {
231        throw new NullPointerException("Required field '_new' cannot be null");
232      }
233      this._new = _new;
234      return this;
235    }
236
237    public Builder modified(Integer modified) {
238      if (modified == null) {
239        throw new NullPointerException("Required field 'modified' cannot be null");
240      }
241      this.modified = modified;
242      return this;
243    }
244
245    public Builder initialized(Integer initialized) {
246      if (initialized == null) {
247        throw new NullPointerException("Required field 'initialized' cannot be null");
248      }
249      this.initialized = initialized;
250      return this;
251    }
252
253    public Builder id(Integer id) {
254      this.id = id;
255      return this;
256    }
257
258    public Builder name(String name) {
259      this.name = name;
260      return this;
261    }
262
263    public Builder leaf(Integer leaf) {
264      this.leaf = leaf;
265      return this;
266    }
267
268    public Builder parent(Integer parent) {
269      this.parent = parent;
270      return this;
271    }
272
273    public Builder rootGroup(Integer rootGroup) {
274      this.rootGroup = rootGroup;
275      return this;
276    }
277
278    public Builder remark(String remark) {
279      this.remark = remark;
280      return this;
281    }
282
283    public Builder extBin(ByteString extBin) {
284      this.extBin = extBin;
285      return this;
286    }
287
288    public Builder extTxt(String extTxt) {
289      this.extTxt = extTxt;
290      return this;
291    }
292
293    public Builder createTime(Long createTime) {
294      this.createTime = createTime;
295      return this;
296    }
297
298    public Builder updateTime(Long updateTime) {
299      this.updateTime = updateTime;
300      return this;
301    }
302
303    @Override
304    public PersonGroupBean build() {
305      if (this._new == null) {
306        throw new IllegalStateException("Required field '_new' is missing");
307      }
308      if (this.modified == null) {
309        throw new IllegalStateException("Required field 'modified' is missing");
310      }
311      if (this.initialized == null) {
312        throw new IllegalStateException("Required field 'initialized' is missing");
313      }
314      return new PersonGroupBean(this);
315    }
316
317    @Override
318    public void reset() {
319      this._new = null;
320      this.modified = null;
321      this.initialized = null;
322      this.id = null;
323      this.name = null;
324      this.leaf = null;
325      this.parent = null;
326      this.rootGroup = null;
327      this.remark = null;
328      this.extBin = null;
329      this.extTxt = null;
330      this.createTime = null;
331      this.updateTime = null;
332    }
333  }
334
335  private static final class PersonGroupBeanAdapter implements Adapter<PersonGroupBean, Builder> {
336    @Override
337    public void write(Protocol protocol, PersonGroupBean struct) throws IOException {
338      protocol.writeStructBegin("PersonGroupBean");
339      protocol.writeFieldBegin("_new", 1, TType.BOOL);
340      protocol.writeBool(struct._new);
341      protocol.writeFieldEnd();
342      protocol.writeFieldBegin("modified", 2, TType.I32);
343      protocol.writeI32(struct.modified);
344      protocol.writeFieldEnd();
345      protocol.writeFieldBegin("initialized", 3, TType.I32);
346      protocol.writeI32(struct.initialized);
347      protocol.writeFieldEnd();
348      if (struct.id != null) {
349        protocol.writeFieldBegin("id", 4, TType.I32);
350        protocol.writeI32(struct.id);
351        protocol.writeFieldEnd();
352      }
353      if (struct.name != null) {
354        protocol.writeFieldBegin("name", 5, TType.STRING);
355        protocol.writeString(struct.name);
356        protocol.writeFieldEnd();
357      }
358      if (struct.leaf != null) {
359        protocol.writeFieldBegin("leaf", 6, TType.I32);
360        protocol.writeI32(struct.leaf);
361        protocol.writeFieldEnd();
362      }
363      if (struct.parent != null) {
364        protocol.writeFieldBegin("parent", 7, TType.I32);
365        protocol.writeI32(struct.parent);
366        protocol.writeFieldEnd();
367      }
368      if (struct.rootGroup != null) {
369        protocol.writeFieldBegin("rootGroup", 8, TType.I32);
370        protocol.writeI32(struct.rootGroup);
371        protocol.writeFieldEnd();
372      }
373      if (struct.remark != null) {
374        protocol.writeFieldBegin("remark", 9, TType.STRING);
375        protocol.writeString(struct.remark);
376        protocol.writeFieldEnd();
377      }
378      if (struct.extBin != null) {
379        protocol.writeFieldBegin("extBin", 10, TType.STRING);
380        protocol.writeBinary(struct.extBin);
381        protocol.writeFieldEnd();
382      }
383      if (struct.extTxt != null) {
384        protocol.writeFieldBegin("extTxt", 11, TType.STRING);
385        protocol.writeString(struct.extTxt);
386        protocol.writeFieldEnd();
387      }
388      if (struct.createTime != null) {
389        protocol.writeFieldBegin("createTime", 12, TType.I64);
390        protocol.writeI64(struct.createTime);
391        protocol.writeFieldEnd();
392      }
393      if (struct.updateTime != null) {
394        protocol.writeFieldBegin("updateTime", 13, TType.I64);
395        protocol.writeI64(struct.updateTime);
396        protocol.writeFieldEnd();
397      }
398      protocol.writeFieldStop();
399      protocol.writeStructEnd();
400    }
401
402    @Override
403    public PersonGroupBean read(Protocol protocol, Builder builder) throws IOException {
404      protocol.readStructBegin();
405      while (true) {
406        FieldMetadata field = protocol.readFieldBegin();
407        if (field.typeId == TType.STOP) {
408          break;
409        }
410        switch (field.fieldId) {
411          case 1: {
412            if (field.typeId == TType.BOOL) {
413              boolean value = protocol.readBool();
414              builder._new(value);
415            } else {
416              ProtocolUtil.skip(protocol, field.typeId);
417            }
418          }
419          break;
420          case 2: {
421            if (field.typeId == TType.I32) {
422              int value = protocol.readI32();
423              builder.modified(value);
424            } else {
425              ProtocolUtil.skip(protocol, field.typeId);
426            }
427          }
428          break;
429          case 3: {
430            if (field.typeId == TType.I32) {
431              int value = protocol.readI32();
432              builder.initialized(value);
433            } else {
434              ProtocolUtil.skip(protocol, field.typeId);
435            }
436          }
437          break;
438          case 4: {
439            if (field.typeId == TType.I32) {
440              int value = protocol.readI32();
441              builder.id(value);
442            } else {
443              ProtocolUtil.skip(protocol, field.typeId);
444            }
445          }
446          break;
447          case 5: {
448            if (field.typeId == TType.STRING) {
449              String value = protocol.readString();
450              builder.name(value);
451            } else {
452              ProtocolUtil.skip(protocol, field.typeId);
453            }
454          }
455          break;
456          case 6: {
457            if (field.typeId == TType.I32) {
458              int value = protocol.readI32();
459              builder.leaf(value);
460            } else {
461              ProtocolUtil.skip(protocol, field.typeId);
462            }
463          }
464          break;
465          case 7: {
466            if (field.typeId == TType.I32) {
467              int value = protocol.readI32();
468              builder.parent(value);
469            } else {
470              ProtocolUtil.skip(protocol, field.typeId);
471            }
472          }
473          break;
474          case 8: {
475            if (field.typeId == TType.I32) {
476              int value = protocol.readI32();
477              builder.rootGroup(value);
478            } else {
479              ProtocolUtil.skip(protocol, field.typeId);
480            }
481          }
482          break;
483          case 9: {
484            if (field.typeId == TType.STRING) {
485              String value = protocol.readString();
486              builder.remark(value);
487            } else {
488              ProtocolUtil.skip(protocol, field.typeId);
489            }
490          }
491          break;
492          case 10: {
493            if (field.typeId == TType.STRING) {
494              ByteString value = protocol.readBinary();
495              builder.extBin(value);
496            } else {
497              ProtocolUtil.skip(protocol, field.typeId);
498            }
499          }
500          break;
501          case 11: {
502            if (field.typeId == TType.STRING) {
503              String value = protocol.readString();
504              builder.extTxt(value);
505            } else {
506              ProtocolUtil.skip(protocol, field.typeId);
507            }
508          }
509          break;
510          case 12: {
511            if (field.typeId == TType.I64) {
512              long value = protocol.readI64();
513              builder.createTime(value);
514            } else {
515              ProtocolUtil.skip(protocol, field.typeId);
516            }
517          }
518          break;
519          case 13: {
520            if (field.typeId == TType.I64) {
521              long value = protocol.readI64();
522              builder.updateTime(value);
523            } else {
524              ProtocolUtil.skip(protocol, field.typeId);
525            }
526          }
527          break;
528          default: {
529            ProtocolUtil.skip(protocol, field.typeId);
530          }
531          break;
532        }
533        protocol.readFieldEnd();
534      }
535      protocol.readStructEnd();
536      return builder.build();
537    }
538
539    @Override
540    public PersonGroupBean read(Protocol protocol) throws IOException {
541      return read(protocol, new Builder());
542    }
543  }
544}