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