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