001// Automatically generated by the Thrifty compiler; do not edit! 002// Generated on: 2020-11-05T09:22:38.124Z 003// Source: J:\facelog\facelog-service\IFaceLog.thrift at 232: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 LogLightBean implements Struct { 022 public static final Adapter<LogLightBean, Builder> ADAPTER = new LogLightBeanAdapter(); 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 Integer personId; 053 054 @ThriftField( 055 fieldId = 6, 056 isOptional = true 057 ) 058 public final String name; 059 060 @ThriftField( 061 fieldId = 7, 062 isOptional = true 063 ) 064 public final Integer papersType; 065 066 @ThriftField( 067 fieldId = 8, 068 isOptional = true 069 ) 070 public final String papersNum; 071 072 @ThriftField( 073 fieldId = 9, 074 isOptional = true 075 ) 076 public final Integer deviceId; 077 078 @ThriftField( 079 fieldId = 10, 080 isOptional = true 081 ) 082 public final Integer verifyType; 083 084 @ThriftField( 085 fieldId = 11, 086 isOptional = true 087 ) 088 public final Long verifyTime; 089 090 @ThriftField( 091 fieldId = 12, 092 isOptional = true 093 ) 094 public final Integer direction; 095 096 @ThriftField( 097 fieldId = 13, 098 isOptional = true 099 ) 100 public final Double temperature; 101 102 @ThriftField( 103 fieldId = 14, 104 isOptional = true 105 ) 106 public final String imageMd5; 107 108 @ThriftField( 109 fieldId = 15, 110 isOptional = true 111 ) 112 public final String props; 113 114 private LogLightBean(Builder builder) { 115 this._new = builder._new; 116 this.modified = builder.modified; 117 this.initialized = builder.initialized; 118 this.id = builder.id; 119 this.personId = builder.personId; 120 this.name = builder.name; 121 this.papersType = builder.papersType; 122 this.papersNum = builder.papersNum; 123 this.deviceId = builder.deviceId; 124 this.verifyType = builder.verifyType; 125 this.verifyTime = builder.verifyTime; 126 this.direction = builder.direction; 127 this.temperature = builder.temperature; 128 this.imageMd5 = builder.imageMd5; 129 this.props = builder.props; 130 } 131 132 @Override 133 @SuppressWarnings({"NumberEquality", "StringEquality"}) 134 public boolean equals(Object other) { 135 if (this == other) return true; 136 if (other == null) return false; 137 if (!(other instanceof LogLightBean)) return false; 138 LogLightBean that = (LogLightBean) other; 139 return (this._new == that._new || this._new.equals(that._new)) 140 && (this.modified == that.modified || this.modified.equals(that.modified)) 141 && (this.initialized == that.initialized || this.initialized.equals(that.initialized)) 142 && (this.id == that.id || (this.id != null && this.id.equals(that.id))) 143 && (this.personId == that.personId || (this.personId != null && this.personId.equals(that.personId))) 144 && (this.name == that.name || (this.name != null && this.name.equals(that.name))) 145 && (this.papersType == that.papersType || (this.papersType != null && this.papersType.equals(that.papersType))) 146 && (this.papersNum == that.papersNum || (this.papersNum != null && this.papersNum.equals(that.papersNum))) 147 && (this.deviceId == that.deviceId || (this.deviceId != null && this.deviceId.equals(that.deviceId))) 148 && (this.verifyType == that.verifyType || (this.verifyType != null && this.verifyType.equals(that.verifyType))) 149 && (this.verifyTime == that.verifyTime || (this.verifyTime != null && this.verifyTime.equals(that.verifyTime))) 150 && (this.direction == that.direction || (this.direction != null && this.direction.equals(that.direction))) 151 && (this.temperature == that.temperature || (this.temperature != null && this.temperature.equals(that.temperature))) 152 && (this.imageMd5 == that.imageMd5 || (this.imageMd5 != null && this.imageMd5.equals(that.imageMd5))) 153 && (this.props == that.props || (this.props != null && this.props.equals(that.props))); 154 } 155 156 @Override 157 public int hashCode() { 158 int code = 16777619; 159 code ^= this._new.hashCode(); 160 code *= 0x811c9dc5; 161 code ^= this.modified.hashCode(); 162 code *= 0x811c9dc5; 163 code ^= this.initialized.hashCode(); 164 code *= 0x811c9dc5; 165 code ^= (this.id == null) ? 0 : this.id.hashCode(); 166 code *= 0x811c9dc5; 167 code ^= (this.personId == null) ? 0 : this.personId.hashCode(); 168 code *= 0x811c9dc5; 169 code ^= (this.name == null) ? 0 : this.name.hashCode(); 170 code *= 0x811c9dc5; 171 code ^= (this.papersType == null) ? 0 : this.papersType.hashCode(); 172 code *= 0x811c9dc5; 173 code ^= (this.papersNum == null) ? 0 : this.papersNum.hashCode(); 174 code *= 0x811c9dc5; 175 code ^= (this.deviceId == null) ? 0 : this.deviceId.hashCode(); 176 code *= 0x811c9dc5; 177 code ^= (this.verifyType == null) ? 0 : this.verifyType.hashCode(); 178 code *= 0x811c9dc5; 179 code ^= (this.verifyTime == null) ? 0 : this.verifyTime.hashCode(); 180 code *= 0x811c9dc5; 181 code ^= (this.direction == null) ? 0 : this.direction.hashCode(); 182 code *= 0x811c9dc5; 183 code ^= (this.temperature == null) ? 0 : this.temperature.hashCode(); 184 code *= 0x811c9dc5; 185 code ^= (this.imageMd5 == null) ? 0 : this.imageMd5.hashCode(); 186 code *= 0x811c9dc5; 187 code ^= (this.props == null) ? 0 : this.props.hashCode(); 188 code *= 0x811c9dc5; 189 return code; 190 } 191 192 @Override 193 public String toString() { 194 return "LogLightBean{_new=" + this._new + ", modified=" + this.modified + ", initialized=" + this.initialized + ", id=" + this.id + ", personId=" + this.personId + ", name=" + this.name + ", papersType=" + this.papersType + ", papersNum=" + this.papersNum + ", deviceId=" + this.deviceId + ", verifyType=" + this.verifyType + ", verifyTime=" + this.verifyTime + ", direction=" + this.direction + ", temperature=" + this.temperature + ", imageMd5=" + this.imageMd5 + ", props=" + this.props + "}"; 195 } 196 197 @Override 198 public void write(Protocol protocol) throws IOException { 199 ADAPTER.write(protocol, this); 200 } 201 202 public static final class Builder implements StructBuilder<LogLightBean> { 203 private Boolean _new; 204 205 private Integer modified; 206 207 private Integer initialized; 208 209 private Integer id; 210 211 private Integer personId; 212 213 private String name; 214 215 private Integer papersType; 216 217 private String papersNum; 218 219 private Integer deviceId; 220 221 private Integer verifyType; 222 223 private Long verifyTime; 224 225 private Integer direction; 226 227 private Double temperature; 228 229 private String imageMd5; 230 231 private String props; 232 233 public Builder() { 234 } 235 236 public Builder(LogLightBean struct) { 237 this._new = struct._new; 238 this.modified = struct.modified; 239 this.initialized = struct.initialized; 240 this.id = struct.id; 241 this.personId = struct.personId; 242 this.name = struct.name; 243 this.papersType = struct.papersType; 244 this.papersNum = struct.papersNum; 245 this.deviceId = struct.deviceId; 246 this.verifyType = struct.verifyType; 247 this.verifyTime = struct.verifyTime; 248 this.direction = struct.direction; 249 this.temperature = struct.temperature; 250 this.imageMd5 = struct.imageMd5; 251 this.props = struct.props; 252 } 253 254 public Builder _new(Boolean _new) { 255 if (_new == null) { 256 throw new NullPointerException("Required field '_new' cannot be null"); 257 } 258 this._new = _new; 259 return this; 260 } 261 262 public Builder modified(Integer modified) { 263 if (modified == null) { 264 throw new NullPointerException("Required field 'modified' cannot be null"); 265 } 266 this.modified = modified; 267 return this; 268 } 269 270 public Builder initialized(Integer initialized) { 271 if (initialized == null) { 272 throw new NullPointerException("Required field 'initialized' cannot be null"); 273 } 274 this.initialized = initialized; 275 return this; 276 } 277 278 public Builder id(Integer id) { 279 this.id = id; 280 return this; 281 } 282 283 public Builder personId(Integer personId) { 284 this.personId = personId; 285 return this; 286 } 287 288 public Builder name(String name) { 289 this.name = name; 290 return this; 291 } 292 293 public Builder papersType(Integer papersType) { 294 this.papersType = papersType; 295 return this; 296 } 297 298 public Builder papersNum(String papersNum) { 299 this.papersNum = papersNum; 300 return this; 301 } 302 303 public Builder deviceId(Integer deviceId) { 304 this.deviceId = deviceId; 305 return this; 306 } 307 308 public Builder verifyType(Integer verifyType) { 309 this.verifyType = verifyType; 310 return this; 311 } 312 313 public Builder verifyTime(Long verifyTime) { 314 this.verifyTime = verifyTime; 315 return this; 316 } 317 318 public Builder direction(Integer direction) { 319 this.direction = direction; 320 return this; 321 } 322 323 public Builder temperature(Double temperature) { 324 this.temperature = temperature; 325 return this; 326 } 327 328 public Builder imageMd5(String imageMd5) { 329 this.imageMd5 = imageMd5; 330 return this; 331 } 332 333 public Builder props(String props) { 334 this.props = props; 335 return this; 336 } 337 338 @Override 339 public LogLightBean build() { 340 if (this._new == null) { 341 throw new IllegalStateException("Required field '_new' is missing"); 342 } 343 if (this.modified == null) { 344 throw new IllegalStateException("Required field 'modified' is missing"); 345 } 346 if (this.initialized == null) { 347 throw new IllegalStateException("Required field 'initialized' is missing"); 348 } 349 return new LogLightBean(this); 350 } 351 352 @Override 353 public void reset() { 354 this._new = null; 355 this.modified = null; 356 this.initialized = null; 357 this.id = null; 358 this.personId = null; 359 this.name = null; 360 this.papersType = null; 361 this.papersNum = null; 362 this.deviceId = null; 363 this.verifyType = null; 364 this.verifyTime = null; 365 this.direction = null; 366 this.temperature = null; 367 this.imageMd5 = null; 368 this.props = null; 369 } 370 } 371 372 private static final class LogLightBeanAdapter implements Adapter<LogLightBean, Builder> { 373 @Override 374 public void write(Protocol protocol, LogLightBean struct) throws IOException { 375 protocol.writeStructBegin("LogLightBean"); 376 protocol.writeFieldBegin("_new", 1, TType.BOOL); 377 protocol.writeBool(struct._new); 378 protocol.writeFieldEnd(); 379 protocol.writeFieldBegin("modified", 2, TType.I32); 380 protocol.writeI32(struct.modified); 381 protocol.writeFieldEnd(); 382 protocol.writeFieldBegin("initialized", 3, TType.I32); 383 protocol.writeI32(struct.initialized); 384 protocol.writeFieldEnd(); 385 if (struct.id != null) { 386 protocol.writeFieldBegin("id", 4, TType.I32); 387 protocol.writeI32(struct.id); 388 protocol.writeFieldEnd(); 389 } 390 if (struct.personId != null) { 391 protocol.writeFieldBegin("personId", 5, TType.I32); 392 protocol.writeI32(struct.personId); 393 protocol.writeFieldEnd(); 394 } 395 if (struct.name != null) { 396 protocol.writeFieldBegin("name", 6, TType.STRING); 397 protocol.writeString(struct.name); 398 protocol.writeFieldEnd(); 399 } 400 if (struct.papersType != null) { 401 protocol.writeFieldBegin("papersType", 7, TType.I32); 402 protocol.writeI32(struct.papersType); 403 protocol.writeFieldEnd(); 404 } 405 if (struct.papersNum != null) { 406 protocol.writeFieldBegin("papersNum", 8, TType.STRING); 407 protocol.writeString(struct.papersNum); 408 protocol.writeFieldEnd(); 409 } 410 if (struct.deviceId != null) { 411 protocol.writeFieldBegin("deviceId", 9, TType.I32); 412 protocol.writeI32(struct.deviceId); 413 protocol.writeFieldEnd(); 414 } 415 if (struct.verifyType != null) { 416 protocol.writeFieldBegin("verifyType", 10, TType.I32); 417 protocol.writeI32(struct.verifyType); 418 protocol.writeFieldEnd(); 419 } 420 if (struct.verifyTime != null) { 421 protocol.writeFieldBegin("verifyTime", 11, TType.I64); 422 protocol.writeI64(struct.verifyTime); 423 protocol.writeFieldEnd(); 424 } 425 if (struct.direction != null) { 426 protocol.writeFieldBegin("direction", 12, TType.I32); 427 protocol.writeI32(struct.direction); 428 protocol.writeFieldEnd(); 429 } 430 if (struct.temperature != null) { 431 protocol.writeFieldBegin("temperature", 13, TType.DOUBLE); 432 protocol.writeDouble(struct.temperature); 433 protocol.writeFieldEnd(); 434 } 435 if (struct.imageMd5 != null) { 436 protocol.writeFieldBegin("imageMd5", 14, TType.STRING); 437 protocol.writeString(struct.imageMd5); 438 protocol.writeFieldEnd(); 439 } 440 if (struct.props != null) { 441 protocol.writeFieldBegin("props", 15, TType.STRING); 442 protocol.writeString(struct.props); 443 protocol.writeFieldEnd(); 444 } 445 protocol.writeFieldStop(); 446 protocol.writeStructEnd(); 447 } 448 449 @Override 450 public LogLightBean read(Protocol protocol, Builder builder) throws IOException { 451 protocol.readStructBegin(); 452 while (true) { 453 FieldMetadata field = protocol.readFieldBegin(); 454 if (field.typeId == TType.STOP) { 455 break; 456 } 457 switch (field.fieldId) { 458 case 1: { 459 if (field.typeId == TType.BOOL) { 460 boolean value = protocol.readBool(); 461 builder._new(value); 462 } else { 463 ProtocolUtil.skip(protocol, field.typeId); 464 } 465 } 466 break; 467 case 2: { 468 if (field.typeId == TType.I32) { 469 int value = protocol.readI32(); 470 builder.modified(value); 471 } else { 472 ProtocolUtil.skip(protocol, field.typeId); 473 } 474 } 475 break; 476 case 3: { 477 if (field.typeId == TType.I32) { 478 int value = protocol.readI32(); 479 builder.initialized(value); 480 } else { 481 ProtocolUtil.skip(protocol, field.typeId); 482 } 483 } 484 break; 485 case 4: { 486 if (field.typeId == TType.I32) { 487 int value = protocol.readI32(); 488 builder.id(value); 489 } else { 490 ProtocolUtil.skip(protocol, field.typeId); 491 } 492 } 493 break; 494 case 5: { 495 if (field.typeId == TType.I32) { 496 int value = protocol.readI32(); 497 builder.personId(value); 498 } else { 499 ProtocolUtil.skip(protocol, field.typeId); 500 } 501 } 502 break; 503 case 6: { 504 if (field.typeId == TType.STRING) { 505 String value = protocol.readString(); 506 builder.name(value); 507 } else { 508 ProtocolUtil.skip(protocol, field.typeId); 509 } 510 } 511 break; 512 case 7: { 513 if (field.typeId == TType.I32) { 514 int value = protocol.readI32(); 515 builder.papersType(value); 516 } else { 517 ProtocolUtil.skip(protocol, field.typeId); 518 } 519 } 520 break; 521 case 8: { 522 if (field.typeId == TType.STRING) { 523 String value = protocol.readString(); 524 builder.papersNum(value); 525 } else { 526 ProtocolUtil.skip(protocol, field.typeId); 527 } 528 } 529 break; 530 case 9: { 531 if (field.typeId == TType.I32) { 532 int value = protocol.readI32(); 533 builder.deviceId(value); 534 } else { 535 ProtocolUtil.skip(protocol, field.typeId); 536 } 537 } 538 break; 539 case 10: { 540 if (field.typeId == TType.I32) { 541 int value = protocol.readI32(); 542 builder.verifyType(value); 543 } else { 544 ProtocolUtil.skip(protocol, field.typeId); 545 } 546 } 547 break; 548 case 11: { 549 if (field.typeId == TType.I64) { 550 long value = protocol.readI64(); 551 builder.verifyTime(value); 552 } else { 553 ProtocolUtil.skip(protocol, field.typeId); 554 } 555 } 556 break; 557 case 12: { 558 if (field.typeId == TType.I32) { 559 int value = protocol.readI32(); 560 builder.direction(value); 561 } else { 562 ProtocolUtil.skip(protocol, field.typeId); 563 } 564 } 565 break; 566 case 13: { 567 if (field.typeId == TType.DOUBLE) { 568 double value = protocol.readDouble(); 569 builder.temperature(value); 570 } else { 571 ProtocolUtil.skip(protocol, field.typeId); 572 } 573 } 574 break; 575 case 14: { 576 if (field.typeId == TType.STRING) { 577 String value = protocol.readString(); 578 builder.imageMd5(value); 579 } else { 580 ProtocolUtil.skip(protocol, field.typeId); 581 } 582 } 583 break; 584 case 15: { 585 if (field.typeId == TType.STRING) { 586 String value = protocol.readString(); 587 builder.props(value); 588 } else { 589 ProtocolUtil.skip(protocol, field.typeId); 590 } 591 } 592 break; 593 default: { 594 ProtocolUtil.skip(protocol, field.typeId); 595 } 596 break; 597 } 598 protocol.readFieldEnd(); 599 } 600 protocol.readStructEnd(); 601 return builder.build(); 602 } 603 604 @Override 605 public LogLightBean read(Protocol protocol) throws IOException { 606 return read(protocol, new Builder()); 607 } 608 } 609}