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