001// ______________________________________________________ 002// Generated by sql2java - https://github.com/10km/sql2java-2-6-7 (custom branch) 003// modified by guyadong from 004// sql2java original version https://sourceforge.net/projects/sql2java/ 005// JDBC driver used at code generation time: com.mysql.jdbc.Driver 006// template: bean.java.vm 007// ______________________________________________________ 008package net.gdface.facelog.db; 009import java.io.Serializable; 010import java.util.List; 011import java.util.Objects; 012 013import com.facebook.swift.codec.ThriftStruct; 014import com.facebook.swift.codec.ThriftField; 015import com.facebook.swift.codec.ThriftField.Requiredness; 016import io.swagger.annotations.ApiModel; 017import io.swagger.annotations.ApiModelProperty; 018/** 019 * DeviceBean is a mapping of fl_device Table. 020 * <br>Meta Data Information (in progress): 021 * <ul> 022 * <li>comments: 前端设备基本信息 </li> 023 * </ul> 024 * @author guyadong 025*/ 026@ThriftStruct 027@ApiModel(description="前端设备基本信息") 028public final class DeviceBean 029 implements Serializable,BaseBean<DeviceBean>,Comparable<DeviceBean>,Constant,Cloneable 030{ 031 private static final long serialVersionUID = -1983784566394161565L; 032 /** NULL {@link DeviceBean} bean , IMMUTABLE instance */ 033 public static final DeviceBean NULL = new DeviceBean().asNULL().asImmutable(); 034 /** comments:设备id */ 035 @ApiModelProperty(value = "设备id" ,required=true ,dataType="Integer") 036 private Integer id; 037 038 /** comments:所属设备组id */ 039 @ApiModelProperty(value = "所属设备组id" ,dataType="Integer") 040 private Integer groupId; 041 042 /** comments:设备名称 */ 043 @ApiModelProperty(value = "设备名称" ,dataType="String") 044 private String name; 045 046 /** comments:产品名称 */ 047 @ApiModelProperty(value = "产品名称" ,dataType="String") 048 private String productName; 049 050 /** comments:设备型号 */ 051 @ApiModelProperty(value = "设备型号" ,dataType="String") 052 private String model; 053 054 /** comments:设备供应商 */ 055 @ApiModelProperty(value = "设备供应商" ,dataType="String") 056 private String vendor; 057 058 /** comments:设备制造商 */ 059 @ApiModelProperty(value = "设备制造商" ,dataType="String") 060 private String manufacturer; 061 062 /** comments:设备生产日期 */ 063 @ApiModelProperty(value = "设备生产日期" ,dataType="Date") 064 private java.util.Date madeDate; 065 066 /** comments:设备版本号 */ 067 @ApiModelProperty(value = "设备版本号" ,dataType="String") 068 private String version; 069 070 /** comments:支持的特征码(算法)版本号列表(逗号分隔),特征版本号用于区分不同人脸识别算法生成的特征数据(SDK版本号命名允许字母,数字,-,.,_符号) */ 071 @ApiModelProperty(value = "支持的特征码(算法)版本号列表(逗号分隔),特征版本号用于区分不同人脸识别算法生成的特征数据(SDK版本号命名允许字母,数字,-,.,_符号)" ,dataType="String") 072 private String usedSdks; 073 074 /** comments:设备序列号 */ 075 @ApiModelProperty(value = "设备序列号" ,dataType="String") 076 private String serialNo; 077 078 /** comments:6字节MAC地址(HEX) */ 079 @ApiModelProperty(value = "6字节MAC地址(HEX)" ,dataType="String") 080 private String mac; 081 082 /** comments:通行方向,NULL,0:入口,1:出口,默认0 */ 083 @ApiModelProperty(value = "通行方向,NULL,0:入口,1:出口,默认0" ,dataType="Integer") 084 private Integer direction; 085 086 /** comments:备注 */ 087 @ApiModelProperty(value = "备注" ,dataType="String") 088 private String remark; 089 090 /** comments:应用项目自定义二进制扩展字段(最大64KB) */ 091 @ApiModelProperty(value = "应用项目自定义二进制扩展字段(最大64KB)" ,dataType="ByteBuffer") 092 private java.nio.ByteBuffer extBin; 093 094 /** comments:应用项目自定义文本扩展字段(最大64KB) */ 095 @ApiModelProperty(value = "应用项目自定义文本扩展字段(最大64KB)" ,dataType="String") 096 private String extTxt; 097 098 @ApiModelProperty(value = "create_time" ,dataType="Date") 099 private java.util.Date createTime; 100 101 @ApiModelProperty(value = "update_time" ,dataType="Date") 102 private java.util.Date updateTime; 103 104 /** flag whether {@code this} can be modified */ 105 private Boolean immutable; 106 /** columns modified flag */ 107 @ApiModelProperty(value="columns modified flag",dataType="int",required=true) 108 private int modified; 109 /** columns initialized flag */ 110 @ApiModelProperty(value="columns initialized flag",dataType="int",required=true) 111 private int initialized; 112 /** new record flag */ 113 @ApiModelProperty(value="new record flag",dataType="boolean",required=true) 114 private boolean isNew; 115 /** 116 * set immutable status 117 * @return {@code this} 118 */ 119 private DeviceBean immutable(Boolean immutable) { 120 this.immutable = immutable; 121 return this; 122 } 123 /** 124 * set {@code this} as immutable object 125 * @return {@code this} 126 */ 127 public DeviceBean asImmutable() { 128 return immutable(Boolean.TRUE); 129 } 130 /** 131 * @return {@code true} if {@code this} is a mutable object 132 */ 133 public boolean mutable(){ 134 return !Boolean.TRUE.equals(this.immutable); 135 } 136 /** 137 * @return {@code this} 138 * @throws IllegalStateException if {@code this} is a immutable object 139 */ 140 private DeviceBean checkMutable(){ 141 if(!mutable()){ 142 throw new IllegalStateException("this is a immutable object"); 143 } 144 return this; 145 } 146 /** 147 * @return return a new mutable copy of this object. 148 */ 149 public DeviceBean cloneMutable(){ 150 return clone().immutable(null); 151 } 152 @ThriftField(value=1,name="_new",requiredness=Requiredness.REQUIRED) 153 @Override 154 public boolean isNew() 155 { 156 return this.isNew; 157 } 158 159 160 @Override 161 public void isNew(boolean isNew) 162 { 163 this.isNew = isNew; 164 } 165 /** 166 * Specifies to the object if it has been set as new. 167 * 168 * @param isNew the boolean value to be assigned to the isNew field 169 */ 170 @ThriftField() 171 public void setNew(boolean isNew) 172 { 173 this.isNew = isNew; 174 } 175 /** 176 * @return the modified status of columns 177 */ 178 @ThriftField(value=2,requiredness=Requiredness.REQUIRED) 179 public int getModified(){ 180 return modified; 181 } 182 183 /** 184 * @param modified the modified status bit to be assigned to {@link #modified} 185 */ 186 @ThriftField() 187 public void setModified(int modified){ 188 this.modified = modified; 189 } 190 /** 191 * @return the initialized status of columns 192 */ 193 @ThriftField(value=3,requiredness=Requiredness.REQUIRED) 194 public int getInitialized(){ 195 return initialized; 196 } 197 198 /** 199 * @param initialized the initialized status bit to be assigned to {@link #initialized} 200 */ 201 @ThriftField() 202 public void setInitialized(int initialized){ 203 this.initialized = initialized; 204 } 205 protected static final <T extends Comparable<T>>boolean equals(T a, T b) { 206 return a == b || (a != null && 0==a.compareTo(b)); 207 } 208 public DeviceBean(){ 209 super(); 210 reset(); 211 } 212 /** 213 * construct a new instance filled with primary keys 214 * @param id PK# 1 215 */ 216 public DeviceBean(Integer id){ 217 this(); 218 setId(id); 219 } 220 /** 221 * Getter method for {@link #id}.<br> 222 * PRIMARY KEY.<br> 223 * Meta Data Information (in progress): 224 * <ul> 225 * <li>full name: fl_device.id</li> 226 * <li> imported key: fl_log.device_id</li> 227 * <li> imported key: fl_image.device_id</li> 228 * <li>comments: 设备id</li> 229 * <li>AUTO_INCREMENT</li> 230 * <li>NOT NULL</li> 231 * <li>column size: 10</li> 232 * <li>JDBC type returned by the driver: Types.INTEGER</li> 233 * </ul> 234 * 235 * @return the value of id 236 */ 237 @ThriftField(value=4) 238 public Integer getId(){ 239 return id; 240 } 241 /** 242 * Setter method for {@link #id}.<br> 243 * The new value is set only if equals() says it is different, 244 * or if one of either the new value or the current value is null. 245 * In case the new value is different, it is set and the field is marked as 'modified'. 246 * 247 * @param newVal the new value to be assigned to id 248 */ 249 public void setId(Integer newVal) 250 { 251 checkMutable(); 252 253 modified |= FL_DEVICE_ID_ID_MASK; 254 initialized |= FL_DEVICE_ID_ID_MASK; 255 256 if (Objects.equals(newVal, id)) { 257 return; 258 } 259 id = newVal; 260 } 261 /** 262 * setter for thrift:swift support<br> 263 * without modification for {@link #modified} and {@link #initialized}<br> 264 * <b>NOTE:</b>DO NOT use the method in your code 265 */ 266 @ThriftField(name = "id") 267 public void writeId(Integer newVal){ 268 checkMutable(); 269 id = newVal; 270 } 271 /** 272 * Setter method for {@link #id}.<br> 273 * Convenient for those who do not want to deal with Objects for primary types. 274 * 275 * @param newVal the new value to be assigned to id 276 */ 277 public void setId(int newVal) 278 { 279 setId(new Integer(newVal)); 280 } 281 /** 282 * Determines if the id has been modified. 283 * 284 * @return true if the field has been modified, false if the field has not been modified 285 */ 286 public boolean checkIdModified() 287 { 288 return 0L != (modified & FL_DEVICE_ID_ID_MASK); 289 } 290 291 /** 292 * Determines if the id has been initialized.<br> 293 * 294 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 295 * 296 * @return true if the field has been initialized, false otherwise 297 */ 298 public boolean checkIdInitialized() 299 { 300 return 0L != (initialized & FL_DEVICE_ID_ID_MASK); 301 } 302 /** 303 * Getter method for {@link #groupId}.<br> 304 * Meta Data Information (in progress): 305 * <ul> 306 * <li>full name: fl_device.group_id</li> 307 * <li> foreign key: fl_device_group.id</li> 308 * <li>comments: 所属设备组id</li> 309 * <li>default value: '1'</li> 310 * <li>column size: 10</li> 311 * <li>JDBC type returned by the driver: Types.INTEGER</li> 312 * </ul> 313 * 314 * @return the value of groupId 315 */ 316 @ThriftField(value=5) 317 public Integer getGroupId(){ 318 return groupId; 319 } 320 /** 321 * Setter method for {@link #groupId}.<br> 322 * The new value is set only if equals() says it is different, 323 * or if one of either the new value or the current value is null. 324 * In case the new value is different, it is set and the field is marked as 'modified'. 325 * 326 * @param newVal the new value to be assigned to groupId 327 */ 328 public void setGroupId(Integer newVal) 329 { 330 checkMutable(); 331 332 modified |= FL_DEVICE_ID_GROUP_ID_MASK; 333 initialized |= FL_DEVICE_ID_GROUP_ID_MASK; 334 335 if (Objects.equals(newVal, groupId)) { 336 return; 337 } 338 groupId = newVal; 339 } 340 /** 341 * setter for thrift:swift support<br> 342 * without modification for {@link #modified} and {@link #initialized}<br> 343 * <b>NOTE:</b>DO NOT use the method in your code 344 */ 345 @ThriftField(name = "groupId") 346 public void writeGroupId(Integer newVal){ 347 checkMutable(); 348 groupId = newVal; 349 } 350 /** 351 * Setter method for {@link #groupId}.<br> 352 * Convenient for those who do not want to deal with Objects for primary types. 353 * 354 * @param newVal the new value to be assigned to groupId 355 */ 356 public void setGroupId(int newVal) 357 { 358 setGroupId(new Integer(newVal)); 359 } 360 /** 361 * Determines if the groupId has been modified. 362 * 363 * @return true if the field has been modified, false if the field has not been modified 364 */ 365 public boolean checkGroupIdModified() 366 { 367 return 0L != (modified & FL_DEVICE_ID_GROUP_ID_MASK); 368 } 369 370 /** 371 * Determines if the groupId has been initialized.<br> 372 * 373 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 374 * 375 * @return true if the field has been initialized, false otherwise 376 */ 377 public boolean checkGroupIdInitialized() 378 { 379 return 0L != (initialized & FL_DEVICE_ID_GROUP_ID_MASK); 380 } 381 /** 382 * Getter method for {@link #name}.<br> 383 * Meta Data Information (in progress): 384 * <ul> 385 * <li>full name: fl_device.name</li> 386 * <li>comments: 设备名称</li> 387 * <li>column size: 32</li> 388 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 389 * </ul> 390 * 391 * @return the value of name 392 */ 393 @ThriftField(value=6) 394 public String getName(){ 395 return name; 396 } 397 /** 398 * Setter method for {@link #name}.<br> 399 * The new value is set only if equals() says it is different, 400 * or if one of either the new value or the current value is null. 401 * In case the new value is different, it is set and the field is marked as 'modified'. 402 * 403 * @param newVal the new value to be assigned to name 404 */ 405 public void setName(String newVal) 406 { 407 checkMutable(); 408 409 modified |= FL_DEVICE_ID_NAME_MASK; 410 initialized |= FL_DEVICE_ID_NAME_MASK; 411 412 if (Objects.equals(newVal, name)) { 413 return; 414 } 415 name = newVal; 416 } 417 /** 418 * setter for thrift:swift support<br> 419 * without modification for {@link #modified} and {@link #initialized}<br> 420 * <b>NOTE:</b>DO NOT use the method in your code 421 */ 422 @ThriftField(name = "name") 423 public void writeName(String newVal){ 424 checkMutable(); 425 name = newVal; 426 } 427 /** 428 * Determines if the name has been modified. 429 * 430 * @return true if the field has been modified, false if the field has not been modified 431 */ 432 public boolean checkNameModified() 433 { 434 return 0L != (modified & FL_DEVICE_ID_NAME_MASK); 435 } 436 437 /** 438 * Determines if the name has been initialized.<br> 439 * 440 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 441 * 442 * @return true if the field has been initialized, false otherwise 443 */ 444 public boolean checkNameInitialized() 445 { 446 return 0L != (initialized & FL_DEVICE_ID_NAME_MASK); 447 } 448 /** 449 * Getter method for {@link #productName}.<br> 450 * Meta Data Information (in progress): 451 * <ul> 452 * <li>full name: fl_device.product_name</li> 453 * <li>comments: 产品名称</li> 454 * <li>column size: 32</li> 455 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 456 * </ul> 457 * 458 * @return the value of productName 459 */ 460 @ThriftField(value=7) 461 public String getProductName(){ 462 return productName; 463 } 464 /** 465 * Setter method for {@link #productName}.<br> 466 * The new value is set only if equals() says it is different, 467 * or if one of either the new value or the current value is null. 468 * In case the new value is different, it is set and the field is marked as 'modified'. 469 * 470 * @param newVal the new value to be assigned to productName 471 */ 472 public void setProductName(String newVal) 473 { 474 checkMutable(); 475 476 modified |= FL_DEVICE_ID_PRODUCT_NAME_MASK; 477 initialized |= FL_DEVICE_ID_PRODUCT_NAME_MASK; 478 479 if (Objects.equals(newVal, productName)) { 480 return; 481 } 482 productName = newVal; 483 } 484 /** 485 * setter for thrift:swift support<br> 486 * without modification for {@link #modified} and {@link #initialized}<br> 487 * <b>NOTE:</b>DO NOT use the method in your code 488 */ 489 @ThriftField(name = "productName") 490 public void writeProductName(String newVal){ 491 checkMutable(); 492 productName = newVal; 493 } 494 /** 495 * Determines if the productName has been modified. 496 * 497 * @return true if the field has been modified, false if the field has not been modified 498 */ 499 public boolean checkProductNameModified() 500 { 501 return 0L != (modified & FL_DEVICE_ID_PRODUCT_NAME_MASK); 502 } 503 504 /** 505 * Determines if the productName has been initialized.<br> 506 * 507 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 508 * 509 * @return true if the field has been initialized, false otherwise 510 */ 511 public boolean checkProductNameInitialized() 512 { 513 return 0L != (initialized & FL_DEVICE_ID_PRODUCT_NAME_MASK); 514 } 515 /** 516 * Getter method for {@link #model}.<br> 517 * Meta Data Information (in progress): 518 * <ul> 519 * <li>full name: fl_device.model</li> 520 * <li>comments: 设备型号</li> 521 * <li>column size: 32</li> 522 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 523 * </ul> 524 * 525 * @return the value of model 526 */ 527 @ThriftField(value=8) 528 public String getModel(){ 529 return model; 530 } 531 /** 532 * Setter method for {@link #model}.<br> 533 * The new value is set only if equals() says it is different, 534 * or if one of either the new value or the current value is null. 535 * In case the new value is different, it is set and the field is marked as 'modified'. 536 * 537 * @param newVal the new value to be assigned to model 538 */ 539 public void setModel(String newVal) 540 { 541 checkMutable(); 542 543 modified |= FL_DEVICE_ID_MODEL_MASK; 544 initialized |= FL_DEVICE_ID_MODEL_MASK; 545 546 if (Objects.equals(newVal, model)) { 547 return; 548 } 549 model = newVal; 550 } 551 /** 552 * setter for thrift:swift support<br> 553 * without modification for {@link #modified} and {@link #initialized}<br> 554 * <b>NOTE:</b>DO NOT use the method in your code 555 */ 556 @ThriftField(name = "model") 557 public void writeModel(String newVal){ 558 checkMutable(); 559 model = newVal; 560 } 561 /** 562 * Determines if the model has been modified. 563 * 564 * @return true if the field has been modified, false if the field has not been modified 565 */ 566 public boolean checkModelModified() 567 { 568 return 0L != (modified & FL_DEVICE_ID_MODEL_MASK); 569 } 570 571 /** 572 * Determines if the model has been initialized.<br> 573 * 574 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 575 * 576 * @return true if the field has been initialized, false otherwise 577 */ 578 public boolean checkModelInitialized() 579 { 580 return 0L != (initialized & FL_DEVICE_ID_MODEL_MASK); 581 } 582 /** 583 * Getter method for {@link #vendor}.<br> 584 * Meta Data Information (in progress): 585 * <ul> 586 * <li>full name: fl_device.vendor</li> 587 * <li>comments: 设备供应商</li> 588 * <li>column size: 32</li> 589 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 590 * </ul> 591 * 592 * @return the value of vendor 593 */ 594 @ThriftField(value=9) 595 public String getVendor(){ 596 return vendor; 597 } 598 /** 599 * Setter method for {@link #vendor}.<br> 600 * The new value is set only if equals() says it is different, 601 * or if one of either the new value or the current value is null. 602 * In case the new value is different, it is set and the field is marked as 'modified'. 603 * 604 * @param newVal the new value to be assigned to vendor 605 */ 606 public void setVendor(String newVal) 607 { 608 checkMutable(); 609 610 modified |= FL_DEVICE_ID_VENDOR_MASK; 611 initialized |= FL_DEVICE_ID_VENDOR_MASK; 612 613 if (Objects.equals(newVal, vendor)) { 614 return; 615 } 616 vendor = newVal; 617 } 618 /** 619 * setter for thrift:swift support<br> 620 * without modification for {@link #modified} and {@link #initialized}<br> 621 * <b>NOTE:</b>DO NOT use the method in your code 622 */ 623 @ThriftField(name = "vendor") 624 public void writeVendor(String newVal){ 625 checkMutable(); 626 vendor = newVal; 627 } 628 /** 629 * Determines if the vendor has been modified. 630 * 631 * @return true if the field has been modified, false if the field has not been modified 632 */ 633 public boolean checkVendorModified() 634 { 635 return 0L != (modified & FL_DEVICE_ID_VENDOR_MASK); 636 } 637 638 /** 639 * Determines if the vendor has been initialized.<br> 640 * 641 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 642 * 643 * @return true if the field has been initialized, false otherwise 644 */ 645 public boolean checkVendorInitialized() 646 { 647 return 0L != (initialized & FL_DEVICE_ID_VENDOR_MASK); 648 } 649 /** 650 * Getter method for {@link #manufacturer}.<br> 651 * Meta Data Information (in progress): 652 * <ul> 653 * <li>full name: fl_device.manufacturer</li> 654 * <li>comments: 设备制造商</li> 655 * <li>column size: 32</li> 656 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 657 * </ul> 658 * 659 * @return the value of manufacturer 660 */ 661 @ThriftField(value=10) 662 public String getManufacturer(){ 663 return manufacturer; 664 } 665 /** 666 * Setter method for {@link #manufacturer}.<br> 667 * The new value is set only if equals() says it is different, 668 * or if one of either the new value or the current value is null. 669 * In case the new value is different, it is set and the field is marked as 'modified'. 670 * 671 * @param newVal the new value to be assigned to manufacturer 672 */ 673 public void setManufacturer(String newVal) 674 { 675 checkMutable(); 676 677 modified |= FL_DEVICE_ID_MANUFACTURER_MASK; 678 initialized |= FL_DEVICE_ID_MANUFACTURER_MASK; 679 680 if (Objects.equals(newVal, manufacturer)) { 681 return; 682 } 683 manufacturer = newVal; 684 } 685 /** 686 * setter for thrift:swift support<br> 687 * without modification for {@link #modified} and {@link #initialized}<br> 688 * <b>NOTE:</b>DO NOT use the method in your code 689 */ 690 @ThriftField(name = "manufacturer") 691 public void writeManufacturer(String newVal){ 692 checkMutable(); 693 manufacturer = newVal; 694 } 695 /** 696 * Determines if the manufacturer has been modified. 697 * 698 * @return true if the field has been modified, false if the field has not been modified 699 */ 700 public boolean checkManufacturerModified() 701 { 702 return 0L != (modified & FL_DEVICE_ID_MANUFACTURER_MASK); 703 } 704 705 /** 706 * Determines if the manufacturer has been initialized.<br> 707 * 708 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 709 * 710 * @return true if the field has been initialized, false otherwise 711 */ 712 public boolean checkManufacturerInitialized() 713 { 714 return 0L != (initialized & FL_DEVICE_ID_MANUFACTURER_MASK); 715 } 716 /** 717 * Getter method for {@link #madeDate}.<br> 718 * Meta Data Information (in progress): 719 * <ul> 720 * <li>full name: fl_device.made_date</li> 721 * <li>comments: 设备生产日期</li> 722 * <li>column size: 10</li> 723 * <li>JDBC type returned by the driver: Types.DATE</li> 724 * </ul> 725 * 726 * @return the value of madeDate 727 */ 728 public java.util.Date getMadeDate(){ 729 return madeDate; 730 } 731 /** 732 * use Long to represent date type for thrift:swift support 733 * @see #getMadeDate() 734 */ 735 @ThriftField(name = "madeDate",value = 11) 736 public Long readMadeDate(){ 737 return null == madeDate ? null:madeDate.getTime(); 738 } 739 /** 740 * Setter method for {@link #madeDate}.<br> 741 * The new value is set only if equals() says it is different, 742 * or if one of either the new value or the current value is null. 743 * In case the new value is different, it is set and the field is marked as 'modified'. 744 * 745 * @param newVal the new value to be assigned to madeDate 746 */ 747 public void setMadeDate(java.util.Date newVal) 748 { 749 checkMutable(); 750 751 modified |= FL_DEVICE_ID_MADE_DATE_MASK; 752 initialized |= FL_DEVICE_ID_MADE_DATE_MASK; 753 754 if (Objects.equals(newVal, madeDate)) { 755 return; 756 } 757 madeDate = newVal; 758 } 759 /** 760 * setter for thrift:swift support<br> 761 * without modification for {@link #modified} and {@link #initialized}<br> 762 * <b>NOTE:</b>DO NOT use the method in your code 763 */ 764 @ThriftField(name = "madeDate") 765 public void writeMadeDate(Long newVal){ 766 checkMutable(); 767 madeDate = null == newVal?null:new java.util.Date(newVal); 768 } 769 /** 770 * Setter method for {@link #madeDate}.<br> 771 * Convenient for those who do not want to deal with Objects for primary types. 772 * 773 * @param newVal the new value to be assigned to madeDate 774 */ 775 public void setMadeDate(long newVal) 776 { 777 setMadeDate(new java.util.Date(newVal)); 778 } 779 /** 780 * Setter method for {@link #madeDate}.<br> 781 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 782 */ 783 public void setMadeDate(Long newVal) 784 { 785 setMadeDate(null == newVal ? null : new java.util.Date(newVal)); 786 } 787 /** 788 * Determines if the madeDate has been modified. 789 * 790 * @return true if the field has been modified, false if the field has not been modified 791 */ 792 public boolean checkMadeDateModified() 793 { 794 return 0L != (modified & FL_DEVICE_ID_MADE_DATE_MASK); 795 } 796 797 /** 798 * Determines if the madeDate has been initialized.<br> 799 * 800 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 801 * 802 * @return true if the field has been initialized, false otherwise 803 */ 804 public boolean checkMadeDateInitialized() 805 { 806 return 0L != (initialized & FL_DEVICE_ID_MADE_DATE_MASK); 807 } 808 /** 809 * Getter method for {@link #version}.<br> 810 * Meta Data Information (in progress): 811 * <ul> 812 * <li>full name: fl_device.version</li> 813 * <li>comments: 设备版本号</li> 814 * <li>column size: 32</li> 815 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 816 * </ul> 817 * 818 * @return the value of version 819 */ 820 @ThriftField(value=12) 821 public String getVersion(){ 822 return version; 823 } 824 /** 825 * Setter method for {@link #version}.<br> 826 * The new value is set only if equals() says it is different, 827 * or if one of either the new value or the current value is null. 828 * In case the new value is different, it is set and the field is marked as 'modified'. 829 * 830 * @param newVal the new value to be assigned to version 831 */ 832 public void setVersion(String newVal) 833 { 834 checkMutable(); 835 836 modified |= FL_DEVICE_ID_VERSION_MASK; 837 initialized |= FL_DEVICE_ID_VERSION_MASK; 838 839 if (Objects.equals(newVal, version)) { 840 return; 841 } 842 version = newVal; 843 } 844 /** 845 * setter for thrift:swift support<br> 846 * without modification for {@link #modified} and {@link #initialized}<br> 847 * <b>NOTE:</b>DO NOT use the method in your code 848 */ 849 @ThriftField(name = "version") 850 public void writeVersion(String newVal){ 851 checkMutable(); 852 version = newVal; 853 } 854 /** 855 * Determines if the version has been modified. 856 * 857 * @return true if the field has been modified, false if the field has not been modified 858 */ 859 public boolean checkVersionModified() 860 { 861 return 0L != (modified & FL_DEVICE_ID_VERSION_MASK); 862 } 863 864 /** 865 * Determines if the version has been initialized.<br> 866 * 867 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 868 * 869 * @return true if the field has been initialized, false otherwise 870 */ 871 public boolean checkVersionInitialized() 872 { 873 return 0L != (initialized & FL_DEVICE_ID_VERSION_MASK); 874 } 875 /** 876 * Getter method for {@link #usedSdks}.<br> 877 * Meta Data Information (in progress): 878 * <ul> 879 * <li>full name: fl_device.used_sdks</li> 880 * <li>comments: 支持的特征码(算法)版本号列表(逗号分隔),特征版本号用于区分不同人脸识别算法生成的特征数据(SDK版本号命名允许字母,数字,-,.,_符号)</li> 881 * <li>column size: 128</li> 882 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 883 * </ul> 884 * 885 * @return the value of usedSdks 886 */ 887 @ThriftField(value=13) 888 public String getUsedSdks(){ 889 return usedSdks; 890 } 891 /** 892 * Setter method for {@link #usedSdks}.<br> 893 * The new value is set only if equals() says it is different, 894 * or if one of either the new value or the current value is null. 895 * In case the new value is different, it is set and the field is marked as 'modified'. 896 * 897 * @param newVal the new value to be assigned to usedSdks 898 */ 899 public void setUsedSdks(String newVal) 900 { 901 checkMutable(); 902 903 modified |= FL_DEVICE_ID_USED_SDKS_MASK; 904 initialized |= FL_DEVICE_ID_USED_SDKS_MASK; 905 906 if (Objects.equals(newVal, usedSdks)) { 907 return; 908 } 909 usedSdks = newVal; 910 } 911 /** 912 * setter for thrift:swift support<br> 913 * without modification for {@link #modified} and {@link #initialized}<br> 914 * <b>NOTE:</b>DO NOT use the method in your code 915 */ 916 @ThriftField(name = "usedSdks") 917 public void writeUsedSdks(String newVal){ 918 checkMutable(); 919 usedSdks = newVal; 920 } 921 /** 922 * Determines if the usedSdks has been modified. 923 * 924 * @return true if the field has been modified, false if the field has not been modified 925 */ 926 public boolean checkUsedSdksModified() 927 { 928 return 0L != (modified & FL_DEVICE_ID_USED_SDKS_MASK); 929 } 930 931 /** 932 * Determines if the usedSdks has been initialized.<br> 933 * 934 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 935 * 936 * @return true if the field has been initialized, false otherwise 937 */ 938 public boolean checkUsedSdksInitialized() 939 { 940 return 0L != (initialized & FL_DEVICE_ID_USED_SDKS_MASK); 941 } 942 /** 943 * Getter method for {@link #serialNo}.<br> 944 * Meta Data Information (in progress): 945 * <ul> 946 * <li>full name: fl_device.serial_no</li> 947 * <li>comments: 设备序列号</li> 948 * <li>column size: 32</li> 949 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 950 * </ul> 951 * 952 * @return the value of serialNo 953 */ 954 @ThriftField(value=14) 955 public String getSerialNo(){ 956 return serialNo; 957 } 958 /** 959 * Setter method for {@link #serialNo}.<br> 960 * The new value is set only if equals() says it is different, 961 * or if one of either the new value or the current value is null. 962 * In case the new value is different, it is set and the field is marked as 'modified'. 963 * 964 * @param newVal the new value to be assigned to serialNo 965 */ 966 public void setSerialNo(String newVal) 967 { 968 checkMutable(); 969 970 modified |= FL_DEVICE_ID_SERIAL_NO_MASK; 971 initialized |= FL_DEVICE_ID_SERIAL_NO_MASK; 972 973 if (Objects.equals(newVal, serialNo)) { 974 return; 975 } 976 serialNo = newVal; 977 } 978 /** 979 * setter for thrift:swift support<br> 980 * without modification for {@link #modified} and {@link #initialized}<br> 981 * <b>NOTE:</b>DO NOT use the method in your code 982 */ 983 @ThriftField(name = "serialNo") 984 public void writeSerialNo(String newVal){ 985 checkMutable(); 986 serialNo = newVal; 987 } 988 /** 989 * Determines if the serialNo has been modified. 990 * 991 * @return true if the field has been modified, false if the field has not been modified 992 */ 993 public boolean checkSerialNoModified() 994 { 995 return 0L != (modified & FL_DEVICE_ID_SERIAL_NO_MASK); 996 } 997 998 /** 999 * Determines if the serialNo has been initialized.<br> 1000 * 1001 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1002 * 1003 * @return true if the field has been initialized, false otherwise 1004 */ 1005 public boolean checkSerialNoInitialized() 1006 { 1007 return 0L != (initialized & FL_DEVICE_ID_SERIAL_NO_MASK); 1008 } 1009 /** 1010 * Getter method for {@link #mac}.<br> 1011 * Meta Data Information (in progress): 1012 * <ul> 1013 * <li>full name: fl_device.mac</li> 1014 * <li>comments: 6字节MAC地址(HEX)</li> 1015 * <li>column size: 12</li> 1016 * <li>JDBC type returned by the driver: Types.CHAR</li> 1017 * </ul> 1018 * 1019 * @return the value of mac 1020 */ 1021 @ThriftField(value=15) 1022 public String getMac(){ 1023 return mac; 1024 } 1025 /** 1026 * Setter method for {@link #mac}.<br> 1027 * The new value is set only if equals() says it is different, 1028 * or if one of either the new value or the current value is null. 1029 * In case the new value is different, it is set and the field is marked as 'modified'. 1030 * 1031 * @param newVal the new value to be assigned to mac 1032 */ 1033 public void setMac(String newVal) 1034 { 1035 checkMutable(); 1036 1037 modified |= FL_DEVICE_ID_MAC_MASK; 1038 initialized |= FL_DEVICE_ID_MAC_MASK; 1039 1040 if (Objects.equals(newVal, mac)) { 1041 return; 1042 } 1043 mac = newVal; 1044 } 1045 /** 1046 * setter for thrift:swift support<br> 1047 * without modification for {@link #modified} and {@link #initialized}<br> 1048 * <b>NOTE:</b>DO NOT use the method in your code 1049 */ 1050 @ThriftField(name = "mac") 1051 public void writeMac(String newVal){ 1052 checkMutable(); 1053 mac = newVal; 1054 } 1055 /** 1056 * Determines if the mac has been modified. 1057 * 1058 * @return true if the field has been modified, false if the field has not been modified 1059 */ 1060 public boolean checkMacModified() 1061 { 1062 return 0L != (modified & FL_DEVICE_ID_MAC_MASK); 1063 } 1064 1065 /** 1066 * Determines if the mac has been initialized.<br> 1067 * 1068 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1069 * 1070 * @return true if the field has been initialized, false otherwise 1071 */ 1072 public boolean checkMacInitialized() 1073 { 1074 return 0L != (initialized & FL_DEVICE_ID_MAC_MASK); 1075 } 1076 /** 1077 * Getter method for {@link #direction}.<br> 1078 * Meta Data Information (in progress): 1079 * <ul> 1080 * <li>full name: fl_device.direction</li> 1081 * <li>comments: 通行方向,NULL,0:入口,1:出口,默认0</li> 1082 * <li>column size: 10</li> 1083 * <li>JDBC type returned by the driver: Types.INTEGER</li> 1084 * </ul> 1085 * 1086 * @return the value of direction 1087 */ 1088 @ThriftField(value=16) 1089 public Integer getDirection(){ 1090 return direction; 1091 } 1092 /** 1093 * Setter method for {@link #direction}.<br> 1094 * The new value is set only if equals() says it is different, 1095 * or if one of either the new value or the current value is null. 1096 * In case the new value is different, it is set and the field is marked as 'modified'. 1097 * 1098 * @param newVal the new value to be assigned to direction 1099 */ 1100 public void setDirection(Integer newVal) 1101 { 1102 checkMutable(); 1103 1104 modified |= FL_DEVICE_ID_DIRECTION_MASK; 1105 initialized |= FL_DEVICE_ID_DIRECTION_MASK; 1106 1107 if (Objects.equals(newVal, direction)) { 1108 return; 1109 } 1110 direction = newVal; 1111 } 1112 /** 1113 * setter for thrift:swift support<br> 1114 * without modification for {@link #modified} and {@link #initialized}<br> 1115 * <b>NOTE:</b>DO NOT use the method in your code 1116 */ 1117 @ThriftField(name = "direction") 1118 public void writeDirection(Integer newVal){ 1119 checkMutable(); 1120 direction = newVal; 1121 } 1122 /** 1123 * Setter method for {@link #direction}.<br> 1124 * Convenient for those who do not want to deal with Objects for primary types. 1125 * 1126 * @param newVal the new value to be assigned to direction 1127 */ 1128 public void setDirection(int newVal) 1129 { 1130 setDirection(new Integer(newVal)); 1131 } 1132 /** 1133 * Determines if the direction has been modified. 1134 * 1135 * @return true if the field has been modified, false if the field has not been modified 1136 */ 1137 public boolean checkDirectionModified() 1138 { 1139 return 0L != (modified & FL_DEVICE_ID_DIRECTION_MASK); 1140 } 1141 1142 /** 1143 * Determines if the direction has been initialized.<br> 1144 * 1145 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1146 * 1147 * @return true if the field has been initialized, false otherwise 1148 */ 1149 public boolean checkDirectionInitialized() 1150 { 1151 return 0L != (initialized & FL_DEVICE_ID_DIRECTION_MASK); 1152 } 1153 /** 1154 * Getter method for {@link #remark}.<br> 1155 * Meta Data Information (in progress): 1156 * <ul> 1157 * <li>full name: fl_device.remark</li> 1158 * <li>comments: 备注</li> 1159 * <li>column size: 256</li> 1160 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 1161 * </ul> 1162 * 1163 * @return the value of remark 1164 */ 1165 @ThriftField(value=17) 1166 public String getRemark(){ 1167 return remark; 1168 } 1169 /** 1170 * Setter method for {@link #remark}.<br> 1171 * The new value is set only if equals() says it is different, 1172 * or if one of either the new value or the current value is null. 1173 * In case the new value is different, it is set and the field is marked as 'modified'. 1174 * 1175 * @param newVal the new value to be assigned to remark 1176 */ 1177 public void setRemark(String newVal) 1178 { 1179 checkMutable(); 1180 1181 modified |= FL_DEVICE_ID_REMARK_MASK; 1182 initialized |= FL_DEVICE_ID_REMARK_MASK; 1183 1184 if (Objects.equals(newVal, remark)) { 1185 return; 1186 } 1187 remark = newVal; 1188 } 1189 /** 1190 * setter for thrift:swift support<br> 1191 * without modification for {@link #modified} and {@link #initialized}<br> 1192 * <b>NOTE:</b>DO NOT use the method in your code 1193 */ 1194 @ThriftField(name = "remark") 1195 public void writeRemark(String newVal){ 1196 checkMutable(); 1197 remark = newVal; 1198 } 1199 /** 1200 * Determines if the remark has been modified. 1201 * 1202 * @return true if the field has been modified, false if the field has not been modified 1203 */ 1204 public boolean checkRemarkModified() 1205 { 1206 return 0L != (modified & FL_DEVICE_ID_REMARK_MASK); 1207 } 1208 1209 /** 1210 * Determines if the remark has been initialized.<br> 1211 * 1212 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1213 * 1214 * @return true if the field has been initialized, false otherwise 1215 */ 1216 public boolean checkRemarkInitialized() 1217 { 1218 return 0L != (initialized & FL_DEVICE_ID_REMARK_MASK); 1219 } 1220 /** 1221 * Getter method for {@link #extBin}.<br> 1222 * Meta Data Information (in progress): 1223 * <ul> 1224 * <li>full name: fl_device.ext_bin</li> 1225 * <li>comments: 应用项目自定义二进制扩展字段(最大64KB)</li> 1226 * <li>column size: 65535</li> 1227 * <li>JDBC type returned by the driver: Types.LONGVARBINARY</li> 1228 * </ul> 1229 * 1230 * @return the value of extBin 1231 */ 1232 @ThriftField(value=18) 1233 public java.nio.ByteBuffer getExtBin(){ 1234 return extBin; 1235 } 1236 /** 1237 * Setter method for {@link #extBin}.<br> 1238 * The new value is set only if equals() says it is different, 1239 * or if one of either the new value or the current value is null. 1240 * In case the new value is different, it is set and the field is marked as 'modified'. 1241 * 1242 * @param newVal the new value to be assigned to extBin 1243 */ 1244 public void setExtBin(java.nio.ByteBuffer newVal) 1245 { 1246 checkMutable(); 1247 1248 modified |= FL_DEVICE_ID_EXT_BIN_MASK; 1249 initialized |= FL_DEVICE_ID_EXT_BIN_MASK; 1250 1251 if (Objects.equals(newVal, extBin)) { 1252 return; 1253 } 1254 extBin = newVal; 1255 } 1256 /** 1257 * setter for thrift:swift support<br> 1258 * without modification for {@link #modified} and {@link #initialized}<br> 1259 * <b>NOTE:</b>DO NOT use the method in your code 1260 */ 1261 @ThriftField(name = "extBin") 1262 public void writeExtBin(java.nio.ByteBuffer newVal){ 1263 checkMutable(); 1264 extBin = newVal; 1265 } 1266 /** 1267 * Determines if the extBin has been modified. 1268 * 1269 * @return true if the field has been modified, false if the field has not been modified 1270 */ 1271 public boolean checkExtBinModified() 1272 { 1273 return 0L != (modified & FL_DEVICE_ID_EXT_BIN_MASK); 1274 } 1275 1276 /** 1277 * Determines if the extBin has been initialized.<br> 1278 * 1279 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1280 * 1281 * @return true if the field has been initialized, false otherwise 1282 */ 1283 public boolean checkExtBinInitialized() 1284 { 1285 return 0L != (initialized & FL_DEVICE_ID_EXT_BIN_MASK); 1286 } 1287 /** 1288 * Getter method for {@link #extTxt}.<br> 1289 * Meta Data Information (in progress): 1290 * <ul> 1291 * <li>full name: fl_device.ext_txt</li> 1292 * <li>comments: 应用项目自定义文本扩展字段(最大64KB)</li> 1293 * <li>column size: 65535</li> 1294 * <li>JDBC type returned by the driver: Types.LONGVARCHAR</li> 1295 * </ul> 1296 * 1297 * @return the value of extTxt 1298 */ 1299 @ThriftField(value=19) 1300 public String getExtTxt(){ 1301 return extTxt; 1302 } 1303 /** 1304 * Setter method for {@link #extTxt}.<br> 1305 * The new value is set only if equals() says it is different, 1306 * or if one of either the new value or the current value is null. 1307 * In case the new value is different, it is set and the field is marked as 'modified'. 1308 * 1309 * @param newVal the new value to be assigned to extTxt 1310 */ 1311 public void setExtTxt(String newVal) 1312 { 1313 checkMutable(); 1314 1315 modified |= FL_DEVICE_ID_EXT_TXT_MASK; 1316 initialized |= FL_DEVICE_ID_EXT_TXT_MASK; 1317 1318 if (Objects.equals(newVal, extTxt)) { 1319 return; 1320 } 1321 extTxt = newVal; 1322 } 1323 /** 1324 * setter for thrift:swift support<br> 1325 * without modification for {@link #modified} and {@link #initialized}<br> 1326 * <b>NOTE:</b>DO NOT use the method in your code 1327 */ 1328 @ThriftField(name = "extTxt") 1329 public void writeExtTxt(String newVal){ 1330 checkMutable(); 1331 extTxt = newVal; 1332 } 1333 /** 1334 * Determines if the extTxt has been modified. 1335 * 1336 * @return true if the field has been modified, false if the field has not been modified 1337 */ 1338 public boolean checkExtTxtModified() 1339 { 1340 return 0L != (modified & FL_DEVICE_ID_EXT_TXT_MASK); 1341 } 1342 1343 /** 1344 * Determines if the extTxt has been initialized.<br> 1345 * 1346 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1347 * 1348 * @return true if the field has been initialized, false otherwise 1349 */ 1350 public boolean checkExtTxtInitialized() 1351 { 1352 return 0L != (initialized & FL_DEVICE_ID_EXT_TXT_MASK); 1353 } 1354 /** 1355 * Getter method for {@link #createTime}.<br> 1356 * Meta Data Information (in progress): 1357 * <ul> 1358 * <li>full name: fl_device.create_time</li> 1359 * <li>default value: 'CURRENT_TIMESTAMP'</li> 1360 * <li>NOT NULL</li> 1361 * <li>column size: 19</li> 1362 * <li>JDBC type returned by the driver: Types.TIMESTAMP</li> 1363 * </ul> 1364 * 1365 * @return the value of createTime 1366 */ 1367 public java.util.Date getCreateTime(){ 1368 return createTime; 1369 } 1370 /** 1371 * use Long to represent date type for thrift:swift support 1372 * @see #getCreateTime() 1373 */ 1374 @ThriftField(name = "createTime",value = 20) 1375 public Long readCreateTime(){ 1376 return null == createTime ? null:createTime.getTime(); 1377 } 1378 /** 1379 * Setter method for {@link #createTime}.<br> 1380 * The new value is set only if equals() says it is different, 1381 * or if one of either the new value or the current value is null. 1382 * In case the new value is different, it is set and the field is marked as 'modified'. 1383 * 1384 * @param newVal the new value( NOT NULL) to be assigned to createTime 1385 */ 1386 public void setCreateTime(java.util.Date newVal) 1387 { 1388 checkMutable(); 1389 1390 modified |= FL_DEVICE_ID_CREATE_TIME_MASK; 1391 initialized |= FL_DEVICE_ID_CREATE_TIME_MASK; 1392 1393 if (Objects.equals(newVal, createTime)) { 1394 return; 1395 } 1396 createTime = newVal; 1397 } 1398 /** 1399 * setter for thrift:swift support<br> 1400 * without modification for {@link #modified} and {@link #initialized}<br> 1401 * <b>NOTE:</b>DO NOT use the method in your code 1402 */ 1403 @ThriftField(name = "createTime") 1404 public void writeCreateTime(Long newVal){ 1405 checkMutable(); 1406 createTime = null == newVal?null:new java.util.Date(newVal); 1407 } 1408 /** 1409 * Setter method for {@link #createTime}.<br> 1410 * Convenient for those who do not want to deal with Objects for primary types. 1411 * 1412 * @param newVal the new value to be assigned to createTime 1413 */ 1414 public void setCreateTime(long newVal) 1415 { 1416 setCreateTime(new java.util.Date(newVal)); 1417 } 1418 /** 1419 * Setter method for {@link #createTime}.<br> 1420 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 1421 */ 1422 public void setCreateTime(Long newVal) 1423 { 1424 setCreateTime(null == newVal ? null : new java.util.Date(newVal)); 1425 } 1426 /** 1427 * Determines if the createTime has been modified. 1428 * 1429 * @return true if the field has been modified, false if the field has not been modified 1430 */ 1431 public boolean checkCreateTimeModified() 1432 { 1433 return 0L != (modified & FL_DEVICE_ID_CREATE_TIME_MASK); 1434 } 1435 1436 /** 1437 * Determines if the createTime has been initialized.<br> 1438 * 1439 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1440 * 1441 * @return true if the field has been initialized, false otherwise 1442 */ 1443 public boolean checkCreateTimeInitialized() 1444 { 1445 return 0L != (initialized & FL_DEVICE_ID_CREATE_TIME_MASK); 1446 } 1447 /** 1448 * Getter method for {@link #updateTime}.<br> 1449 * Meta Data Information (in progress): 1450 * <ul> 1451 * <li>full name: fl_device.update_time</li> 1452 * <li>default value: 'CURRENT_TIMESTAMP'</li> 1453 * <li>NOT NULL</li> 1454 * <li>column size: 19</li> 1455 * <li>JDBC type returned by the driver: Types.TIMESTAMP</li> 1456 * </ul> 1457 * 1458 * @return the value of updateTime 1459 */ 1460 public java.util.Date getUpdateTime(){ 1461 return updateTime; 1462 } 1463 /** 1464 * use Long to represent date type for thrift:swift support 1465 * @see #getUpdateTime() 1466 */ 1467 @ThriftField(name = "updateTime",value = 21) 1468 public Long readUpdateTime(){ 1469 return null == updateTime ? null:updateTime.getTime(); 1470 } 1471 /** 1472 * Setter method for {@link #updateTime}.<br> 1473 * The new value is set only if equals() says it is different, 1474 * or if one of either the new value or the current value is null. 1475 * In case the new value is different, it is set and the field is marked as 'modified'. 1476 * 1477 * @param newVal the new value( NOT NULL) to be assigned to updateTime 1478 */ 1479 public void setUpdateTime(java.util.Date newVal) 1480 { 1481 checkMutable(); 1482 1483 modified |= FL_DEVICE_ID_UPDATE_TIME_MASK; 1484 initialized |= FL_DEVICE_ID_UPDATE_TIME_MASK; 1485 1486 if (Objects.equals(newVal, updateTime)) { 1487 return; 1488 } 1489 updateTime = newVal; 1490 } 1491 /** 1492 * setter for thrift:swift support<br> 1493 * without modification for {@link #modified} and {@link #initialized}<br> 1494 * <b>NOTE:</b>DO NOT use the method in your code 1495 */ 1496 @ThriftField(name = "updateTime") 1497 public void writeUpdateTime(Long newVal){ 1498 checkMutable(); 1499 updateTime = null == newVal?null:new java.util.Date(newVal); 1500 } 1501 /** 1502 * Setter method for {@link #updateTime}.<br> 1503 * Convenient for those who do not want to deal with Objects for primary types. 1504 * 1505 * @param newVal the new value to be assigned to updateTime 1506 */ 1507 public void setUpdateTime(long newVal) 1508 { 1509 setUpdateTime(new java.util.Date(newVal)); 1510 } 1511 /** 1512 * Setter method for {@link #updateTime}.<br> 1513 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 1514 */ 1515 public void setUpdateTime(Long newVal) 1516 { 1517 setUpdateTime(null == newVal ? null : new java.util.Date(newVal)); 1518 } 1519 /** 1520 * Determines if the updateTime has been modified. 1521 * 1522 * @return true if the field has been modified, false if the field has not been modified 1523 */ 1524 public boolean checkUpdateTimeModified() 1525 { 1526 return 0L != (modified & FL_DEVICE_ID_UPDATE_TIME_MASK); 1527 } 1528 1529 /** 1530 * Determines if the updateTime has been initialized.<br> 1531 * 1532 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1533 * 1534 * @return true if the field has been initialized, false otherwise 1535 */ 1536 public boolean checkUpdateTimeInitialized() 1537 { 1538 return 0L != (initialized & FL_DEVICE_ID_UPDATE_TIME_MASK); 1539 } 1540 ////////////////////////////////////// 1541 // referenced bean for FOREIGN KEYS 1542 ////////////////////////////////////// 1543 /** 1544 * The referenced {@link DeviceGroupBean} by {@link #groupId} . <br> 1545 * FOREIGN KEY (group_id) REFERENCES fl_device_group(id) 1546 */ 1547 @ApiModelProperty(hidden = true) 1548 private DeviceGroupBean referencedByGroupId; 1549 /** 1550 * Getter method for {@link #referencedByGroupId}. 1551 * @return DeviceGroupBean 1552 */ 1553 public DeviceGroupBean getReferencedByGroupId() { 1554 return this.referencedByGroupId; 1555 } 1556 /** 1557 * Setter method for {@link #referencedByGroupId}. 1558 * @param reference DeviceGroupBean 1559 */ 1560 public void setReferencedByGroupId(DeviceGroupBean reference) { 1561 this.referencedByGroupId = reference; 1562 } 1563 1564 @Override 1565 public boolean isModified() 1566 { 1567 return 0 != modified; 1568 } 1569 1570 @Override 1571 public boolean isModified(int columnID){ 1572 switch ( columnID ){ 1573 case FL_DEVICE_ID_ID: 1574 return checkIdModified(); 1575 case FL_DEVICE_ID_GROUP_ID: 1576 return checkGroupIdModified(); 1577 case FL_DEVICE_ID_NAME: 1578 return checkNameModified(); 1579 case FL_DEVICE_ID_PRODUCT_NAME: 1580 return checkProductNameModified(); 1581 case FL_DEVICE_ID_MODEL: 1582 return checkModelModified(); 1583 case FL_DEVICE_ID_VENDOR: 1584 return checkVendorModified(); 1585 case FL_DEVICE_ID_MANUFACTURER: 1586 return checkManufacturerModified(); 1587 case FL_DEVICE_ID_MADE_DATE: 1588 return checkMadeDateModified(); 1589 case FL_DEVICE_ID_VERSION: 1590 return checkVersionModified(); 1591 case FL_DEVICE_ID_USED_SDKS: 1592 return checkUsedSdksModified(); 1593 case FL_DEVICE_ID_SERIAL_NO: 1594 return checkSerialNoModified(); 1595 case FL_DEVICE_ID_MAC: 1596 return checkMacModified(); 1597 case FL_DEVICE_ID_DIRECTION: 1598 return checkDirectionModified(); 1599 case FL_DEVICE_ID_REMARK: 1600 return checkRemarkModified(); 1601 case FL_DEVICE_ID_EXT_BIN: 1602 return checkExtBinModified(); 1603 case FL_DEVICE_ID_EXT_TXT: 1604 return checkExtTxtModified(); 1605 case FL_DEVICE_ID_CREATE_TIME: 1606 return checkCreateTimeModified(); 1607 case FL_DEVICE_ID_UPDATE_TIME: 1608 return checkUpdateTimeModified(); 1609 default: 1610 return false; 1611 } 1612 } 1613 1614 @Override 1615 public boolean isInitialized(int columnID){ 1616 switch(columnID) { 1617 case FL_DEVICE_ID_ID: 1618 return checkIdInitialized(); 1619 case FL_DEVICE_ID_GROUP_ID: 1620 return checkGroupIdInitialized(); 1621 case FL_DEVICE_ID_NAME: 1622 return checkNameInitialized(); 1623 case FL_DEVICE_ID_PRODUCT_NAME: 1624 return checkProductNameInitialized(); 1625 case FL_DEVICE_ID_MODEL: 1626 return checkModelInitialized(); 1627 case FL_DEVICE_ID_VENDOR: 1628 return checkVendorInitialized(); 1629 case FL_DEVICE_ID_MANUFACTURER: 1630 return checkManufacturerInitialized(); 1631 case FL_DEVICE_ID_MADE_DATE: 1632 return checkMadeDateInitialized(); 1633 case FL_DEVICE_ID_VERSION: 1634 return checkVersionInitialized(); 1635 case FL_DEVICE_ID_USED_SDKS: 1636 return checkUsedSdksInitialized(); 1637 case FL_DEVICE_ID_SERIAL_NO: 1638 return checkSerialNoInitialized(); 1639 case FL_DEVICE_ID_MAC: 1640 return checkMacInitialized(); 1641 case FL_DEVICE_ID_DIRECTION: 1642 return checkDirectionInitialized(); 1643 case FL_DEVICE_ID_REMARK: 1644 return checkRemarkInitialized(); 1645 case FL_DEVICE_ID_EXT_BIN: 1646 return checkExtBinInitialized(); 1647 case FL_DEVICE_ID_EXT_TXT: 1648 return checkExtTxtInitialized(); 1649 case FL_DEVICE_ID_CREATE_TIME: 1650 return checkCreateTimeInitialized(); 1651 case FL_DEVICE_ID_UPDATE_TIME: 1652 return checkUpdateTimeInitialized(); 1653 default: 1654 return false; 1655 } 1656 } 1657 1658 @Override 1659 public boolean isModified(String column){ 1660 return isModified(columnIDOf(column)); 1661 } 1662 1663 @Override 1664 public boolean isInitialized(String column){ 1665 return isInitialized(columnIDOf(column)); 1666 } 1667 1668 @Override 1669 public void resetIsModified() 1670 { 1671 checkMutable(); 1672 modified = 0; 1673 } 1674 1675 @Override 1676 public void resetPrimaryKeysModified() 1677 { 1678 modified &= (~(FL_DEVICE_ID_ID_MASK)); 1679 } 1680 /** 1681 * Resets columns modification status except primary keys to 'not modified'. 1682 */ 1683 public void resetModifiedExceptPrimaryKeys() 1684 { 1685 modified &= (~(FL_DEVICE_ID_GROUP_ID_MASK | 1686 FL_DEVICE_ID_NAME_MASK | 1687 FL_DEVICE_ID_PRODUCT_NAME_MASK | 1688 FL_DEVICE_ID_MODEL_MASK | 1689 FL_DEVICE_ID_VENDOR_MASK | 1690 FL_DEVICE_ID_MANUFACTURER_MASK | 1691 FL_DEVICE_ID_MADE_DATE_MASK | 1692 FL_DEVICE_ID_VERSION_MASK | 1693 FL_DEVICE_ID_USED_SDKS_MASK | 1694 FL_DEVICE_ID_SERIAL_NO_MASK | 1695 FL_DEVICE_ID_MAC_MASK | 1696 FL_DEVICE_ID_DIRECTION_MASK | 1697 FL_DEVICE_ID_REMARK_MASK | 1698 FL_DEVICE_ID_EXT_BIN_MASK | 1699 FL_DEVICE_ID_EXT_TXT_MASK | 1700 FL_DEVICE_ID_CREATE_TIME_MASK | 1701 FL_DEVICE_ID_UPDATE_TIME_MASK)); 1702 } 1703 /** 1704 * Resets the object initialization status to 'not initialized'. 1705 */ 1706 private void resetInitialized() 1707 { 1708 initialized = 0; 1709 } 1710 /** reset all fields to initial value, equal to a new bean */ 1711 public void reset(){ 1712 checkMutable(); 1713 this.id = null; 1714 /* DEFAULT:'1'*/ 1715 this.groupId = new Integer(1); 1716 this.name = null; 1717 this.productName = null; 1718 this.model = null; 1719 this.vendor = null; 1720 this.manufacturer = null; 1721 this.madeDate = null; 1722 this.version = null; 1723 this.usedSdks = null; 1724 this.serialNo = null; 1725 this.mac = null; 1726 this.direction = null; 1727 this.remark = null; 1728 this.extBin = null; 1729 this.extTxt = null; 1730 /* DEFAULT:'CURRENT_TIMESTAMP'*/ 1731 this.createTime = null; 1732 /* DEFAULT:'CURRENT_TIMESTAMP'*/ 1733 this.updateTime = null; 1734 this.isNew = true; 1735 this.modified = 0; 1736 this.initialized = (FL_DEVICE_ID_GROUP_ID_MASK); 1737 } 1738 @Override 1739 public boolean equals(Object object) 1740 { 1741 if (!(object instanceof DeviceBean)) { 1742 return false; 1743 } 1744 1745 DeviceBean obj = (DeviceBean) object; 1746 return new EqualsBuilder() 1747 .append(getId(), obj.getId()) 1748 .append(getGroupId(), obj.getGroupId()) 1749 .append(getName(), obj.getName()) 1750 .append(getProductName(), obj.getProductName()) 1751 .append(getModel(), obj.getModel()) 1752 .append(getVendor(), obj.getVendor()) 1753 .append(getManufacturer(), obj.getManufacturer()) 1754 .append(getMadeDate(), obj.getMadeDate()) 1755 .append(getVersion(), obj.getVersion()) 1756 .append(getUsedSdks(), obj.getUsedSdks()) 1757 .append(getSerialNo(), obj.getSerialNo()) 1758 .append(getMac(), obj.getMac()) 1759 .append(getDirection(), obj.getDirection()) 1760 .append(getRemark(), obj.getRemark()) 1761 .append(getExtBin(), obj.getExtBin()) 1762 .append(getExtTxt(), obj.getExtTxt()) 1763 .append(getCreateTime(), obj.getCreateTime()) 1764 .append(getUpdateTime(), obj.getUpdateTime()) 1765 .isEquals(); 1766 } 1767 1768 @Override 1769 public int hashCode() 1770 { 1771 return new HashCodeBuilder(-82280557, -700257973) 1772 .append(getId()) 1773 .toHashCode(); 1774 } 1775 1776 @Override 1777 public String toString() { 1778 return toString(true,false); 1779 } 1780 /** 1781 * cast byte array to HEX string 1782 * 1783 * @param input 1784 * @return {@code null} if {@code input} is null 1785 */ 1786 private static final String toHex(byte[] input) { 1787 if (null == input){ 1788 return null; 1789 } 1790 StringBuffer sb = new StringBuffer(input.length * 2); 1791 for (int i = 0; i < input.length; i++) { 1792 sb.append(Character.forDigit((input[i] & 240) >> 4, 16)); 1793 sb.append(Character.forDigit(input[i] & 15, 16)); 1794 } 1795 return sb.toString(); 1796 } 1797 protected static final StringBuilder append(StringBuilder buffer,boolean full,byte[] value){ 1798 if(full || null == value){ 1799 buffer.append(toHex(value)); 1800 }else{ 1801 buffer.append(value.length).append(" bytes"); 1802 } 1803 return buffer; 1804 } 1805 private static int stringLimit = 64; 1806 private static final int MINIMUM_LIMIT = 16; 1807 protected static final StringBuilder append(StringBuilder buffer,boolean full,String value){ 1808 if(full || null == value || value.length() <= stringLimit){ 1809 buffer.append(value); 1810 }else{ 1811 buffer.append(value.substring(0,stringLimit - 8)).append(" ...").append(value.substring(stringLimit-4,stringLimit)); 1812 } 1813 return buffer; 1814 } 1815 protected static final <T>StringBuilder append(StringBuilder buffer,boolean full,T value){ 1816 return buffer.append(value); 1817 } 1818 public static final void setStringLimit(int limit){ 1819 if(limit < MINIMUM_LIMIT){ 1820 throw new IllegalArgumentException(String.format("INVALID limit %d,minimum value %d",limit,MINIMUM_LIMIT)); 1821 } 1822 stringLimit = limit; 1823 } 1824 @Override 1825 public String toString(boolean notNull, boolean fullIfStringOrBytes) { 1826 // only output initialized field 1827 StringBuilder builder = new StringBuilder(this.getClass().getName()).append("@").append(Integer.toHexString(this.hashCode())).append("["); 1828 int count = 0; 1829 if(checkIdInitialized()){ 1830 if(!notNull || null != getId()){ 1831 if(count++ >0){ 1832 builder.append(","); 1833 } 1834 builder.append("id="); 1835 append(builder,fullIfStringOrBytes,getId()); 1836 } 1837 } 1838 if(checkGroupIdInitialized()){ 1839 if(!notNull || null != getGroupId()){ 1840 if(count++ >0){ 1841 builder.append(","); 1842 } 1843 builder.append("group_id="); 1844 append(builder,fullIfStringOrBytes,getGroupId()); 1845 } 1846 } 1847 if(checkNameInitialized()){ 1848 if(!notNull || null != getName()){ 1849 if(count++ >0){ 1850 builder.append(","); 1851 } 1852 builder.append("name="); 1853 append(builder,fullIfStringOrBytes,getName()); 1854 } 1855 } 1856 if(checkProductNameInitialized()){ 1857 if(!notNull || null != getProductName()){ 1858 if(count++ >0){ 1859 builder.append(","); 1860 } 1861 builder.append("product_name="); 1862 append(builder,fullIfStringOrBytes,getProductName()); 1863 } 1864 } 1865 if(checkModelInitialized()){ 1866 if(!notNull || null != getModel()){ 1867 if(count++ >0){ 1868 builder.append(","); 1869 } 1870 builder.append("model="); 1871 append(builder,fullIfStringOrBytes,getModel()); 1872 } 1873 } 1874 if(checkVendorInitialized()){ 1875 if(!notNull || null != getVendor()){ 1876 if(count++ >0){ 1877 builder.append(","); 1878 } 1879 builder.append("vendor="); 1880 append(builder,fullIfStringOrBytes,getVendor()); 1881 } 1882 } 1883 if(checkManufacturerInitialized()){ 1884 if(!notNull || null != getManufacturer()){ 1885 if(count++ >0){ 1886 builder.append(","); 1887 } 1888 builder.append("manufacturer="); 1889 append(builder,fullIfStringOrBytes,getManufacturer()); 1890 } 1891 } 1892 if(checkMadeDateInitialized()){ 1893 if(!notNull || null != getMadeDate()){ 1894 if(count++ >0){ 1895 builder.append(","); 1896 } 1897 builder.append("made_date="); 1898 append(builder,fullIfStringOrBytes,getMadeDate()); 1899 } 1900 } 1901 if(checkVersionInitialized()){ 1902 if(!notNull || null != getVersion()){ 1903 if(count++ >0){ 1904 builder.append(","); 1905 } 1906 builder.append("version="); 1907 append(builder,fullIfStringOrBytes,getVersion()); 1908 } 1909 } 1910 if(checkUsedSdksInitialized()){ 1911 if(!notNull || null != getUsedSdks()){ 1912 if(count++ >0){ 1913 builder.append(","); 1914 } 1915 builder.append("used_sdks="); 1916 append(builder,fullIfStringOrBytes,getUsedSdks()); 1917 } 1918 } 1919 if(checkSerialNoInitialized()){ 1920 if(!notNull || null != getSerialNo()){ 1921 if(count++ >0){ 1922 builder.append(","); 1923 } 1924 builder.append("serial_no="); 1925 append(builder,fullIfStringOrBytes,getSerialNo()); 1926 } 1927 } 1928 if(checkMacInitialized()){ 1929 if(!notNull || null != getMac()){ 1930 if(count++ >0){ 1931 builder.append(","); 1932 } 1933 builder.append("mac="); 1934 append(builder,fullIfStringOrBytes,getMac()); 1935 } 1936 } 1937 if(checkDirectionInitialized()){ 1938 if(!notNull || null != getDirection()){ 1939 if(count++ >0){ 1940 builder.append(","); 1941 } 1942 builder.append("direction="); 1943 append(builder,fullIfStringOrBytes,getDirection()); 1944 } 1945 } 1946 if(checkRemarkInitialized()){ 1947 if(!notNull || null != getRemark()){ 1948 if(count++ >0){ 1949 builder.append(","); 1950 } 1951 builder.append("remark="); 1952 append(builder,fullIfStringOrBytes,getRemark()); 1953 } 1954 } 1955 if(checkExtBinInitialized()){ 1956 if(!notNull || null != getExtBin()){ 1957 if(count++ >0){ 1958 builder.append(","); 1959 } 1960 builder.append("ext_bin="); 1961 append(builder,fullIfStringOrBytes,getExtBin()); 1962 } 1963 } 1964 if(checkExtTxtInitialized()){ 1965 if(!notNull || null != getExtTxt()){ 1966 if(count++ >0){ 1967 builder.append(","); 1968 } 1969 builder.append("ext_txt="); 1970 append(builder,fullIfStringOrBytes,getExtTxt()); 1971 } 1972 } 1973 if(checkCreateTimeInitialized()){ 1974 if(!notNull || null != getCreateTime()){ 1975 if(count++ >0){ 1976 builder.append(","); 1977 } 1978 builder.append("create_time="); 1979 append(builder,fullIfStringOrBytes,getCreateTime()); 1980 } 1981 } 1982 if(checkUpdateTimeInitialized()){ 1983 if(!notNull || null != getUpdateTime()){ 1984 if(count++ >0){ 1985 builder.append(","); 1986 } 1987 builder.append("update_time="); 1988 append(builder,fullIfStringOrBytes,getUpdateTime()); 1989 } 1990 } 1991 builder.append("]"); 1992 return builder.toString(); 1993 } 1994 @Override 1995 public int compareTo(DeviceBean object){ 1996 return new CompareToBuilder() 1997 .append(getId(), object.getId()) 1998 .append(getGroupId(), object.getGroupId()) 1999 .append(getName(), object.getName()) 2000 .append(getProductName(), object.getProductName()) 2001 .append(getModel(), object.getModel()) 2002 .append(getVendor(), object.getVendor()) 2003 .append(getManufacturer(), object.getManufacturer()) 2004 .append(getMadeDate(), object.getMadeDate()) 2005 .append(getVersion(), object.getVersion()) 2006 .append(getUsedSdks(), object.getUsedSdks()) 2007 .append(getSerialNo(), object.getSerialNo()) 2008 .append(getMac(), object.getMac()) 2009 .append(getDirection(), object.getDirection()) 2010 .append(getRemark(), object.getRemark()) 2011 .append(getExtBin(), object.getExtBin()) 2012 .append(getExtTxt(), object.getExtTxt()) 2013 .append(getCreateTime(), object.getCreateTime()) 2014 .append(getUpdateTime(), object.getUpdateTime()) 2015 .toComparison(); 2016 } 2017 @Override 2018 public DeviceBean clone(){ 2019 try { 2020 return (DeviceBean) super.clone(); 2021 } catch (CloneNotSupportedException e) { 2022 throw new RuntimeException(e); 2023 } 2024 } 2025 /** 2026 * Make {@code this} to a NULL bean<br> 2027 * set all fields to null, {@link #modified} and {@link #initialized} be set to 0 2028 * @return {@code this} bean 2029 * @author guyadong 2030 */ 2031 public DeviceBean asNULL() 2032 { 2033 checkMutable(); 2034 2035 setId((Integer)null); 2036 setGroupId((Integer)null); 2037 setName((String)null); 2038 setProductName((String)null); 2039 setModel((String)null); 2040 setVendor((String)null); 2041 setManufacturer((String)null); 2042 setMadeDate((java.util.Date)null); 2043 setVersion((String)null); 2044 setUsedSdks((String)null); 2045 setSerialNo((String)null); 2046 setMac((String)null); 2047 setDirection((Integer)null); 2048 setRemark((String)null); 2049 setExtBin((java.nio.ByteBuffer)null); 2050 setExtTxt((String)null); 2051 setCreateTime((java.util.Date)null); 2052 setUpdateTime((java.util.Date)null); 2053 isNew(true); 2054 resetInitialized(); 2055 resetIsModified(); 2056 return this; 2057 } 2058 /** 2059 * check whether this bean is a NULL bean 2060 * @return {@code true} if {@link #initialized} be set to zero 2061 * @see #asNULL() 2062 */ 2063 public boolean checkNULL(){ 2064 return 0 == getInitialized(); 2065 } 2066 /** 2067 * @param source source list 2068 * @return {@code source} replace {@code null} element with null instance({@link #NULL}) 2069 */ 2070 public static final List<DeviceBean> replaceNull(List<DeviceBean> source){ 2071 if(null != source){ 2072 for(int i = 0,endIndex = source.size();i<endIndex;++i){ 2073 if(null == source.get(i)){ 2074 source.set(i, NULL); 2075 } 2076 } 2077 } 2078 return source; 2079 } 2080 /** 2081 * @param source input list 2082 * @return replace null instance element with {@code null} 2083 * @see #checkNULL() 2084 */ 2085 public static final List<DeviceBean> replaceNullInstance(List<DeviceBean> source){ 2086 if(null != source){ 2087 for(int i = 0,endIndex = source.size();i<endIndex;++i){ 2088 if(source.get(i).checkNULL()){ 2089 source.set(i, null); 2090 } 2091 } 2092 } 2093 return source; 2094 } 2095 @Override 2096 public DeviceBean copy(DeviceBean bean) 2097 { 2098 return copy(bean,new int[]{}); 2099 } 2100 @Override 2101 public DeviceBean copy(DeviceBean bean, int... fieldList) 2102 { 2103 if (null == fieldList || 0 == fieldList.length){ 2104 fieldList = new int[]{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}; 2105 } 2106 for (int i = 0; i < fieldList.length; ++i) { 2107 if( bean.isInitialized(fieldList[i]) && !Objects.deepEquals(bean.getValue(fieldList[i]), getValue(fieldList[i]))){ 2108 setValue(fieldList[i], bean.getValue(fieldList[i])); 2109 } 2110 } 2111 return this; 2112 } 2113 2114 @Override 2115 public DeviceBean copy(DeviceBean bean, String... fieldList) 2116 { 2117 if (null == fieldList || 0 == fieldList.length){ 2118 copy(bean,(int[])null); 2119 }else{ 2120 int field; 2121 for (int i = 0; i < fieldList.length; i++) { 2122 field = columnIDOf(fieldList[i].trim()); 2123 if(bean.isInitialized(field) && !Objects.deepEquals(bean.getValue(field), getValue(field))){ 2124 setValue(field, bean.getValue(field)); 2125 } 2126 } 2127 } 2128 return this; 2129 } 2130 2131 @SuppressWarnings("unchecked") 2132 @Override 2133 public <T>T getValue(int columnID) 2134 { 2135 switch( columnID ){ 2136 case FL_DEVICE_ID_ID: 2137 return (T)getId(); 2138 case FL_DEVICE_ID_GROUP_ID: 2139 return (T)getGroupId(); 2140 case FL_DEVICE_ID_NAME: 2141 return (T)getName(); 2142 case FL_DEVICE_ID_PRODUCT_NAME: 2143 return (T)getProductName(); 2144 case FL_DEVICE_ID_MODEL: 2145 return (T)getModel(); 2146 case FL_DEVICE_ID_VENDOR: 2147 return (T)getVendor(); 2148 case FL_DEVICE_ID_MANUFACTURER: 2149 return (T)getManufacturer(); 2150 case FL_DEVICE_ID_MADE_DATE: 2151 return (T)getMadeDate(); 2152 case FL_DEVICE_ID_VERSION: 2153 return (T)getVersion(); 2154 case FL_DEVICE_ID_USED_SDKS: 2155 return (T)getUsedSdks(); 2156 case FL_DEVICE_ID_SERIAL_NO: 2157 return (T)getSerialNo(); 2158 case FL_DEVICE_ID_MAC: 2159 return (T)getMac(); 2160 case FL_DEVICE_ID_DIRECTION: 2161 return (T)getDirection(); 2162 case FL_DEVICE_ID_REMARK: 2163 return (T)getRemark(); 2164 case FL_DEVICE_ID_EXT_BIN: 2165 return (T)getExtBin(); 2166 case FL_DEVICE_ID_EXT_TXT: 2167 return (T)getExtTxt(); 2168 case FL_DEVICE_ID_CREATE_TIME: 2169 return (T)getCreateTime(); 2170 case FL_DEVICE_ID_UPDATE_TIME: 2171 return (T)getUpdateTime(); 2172 default: 2173 return null; 2174 } 2175 } 2176 2177 @Override 2178 public <T> void setValue(int columnID,T value) 2179 { 2180 switch( columnID ) { 2181 case FL_DEVICE_ID_ID: 2182 setId((Integer)value); 2183 break; 2184 case FL_DEVICE_ID_GROUP_ID: 2185 setGroupId((Integer)value); 2186 break; 2187 case FL_DEVICE_ID_NAME: 2188 setName((String)value); 2189 break; 2190 case FL_DEVICE_ID_PRODUCT_NAME: 2191 setProductName((String)value); 2192 break; 2193 case FL_DEVICE_ID_MODEL: 2194 setModel((String)value); 2195 break; 2196 case FL_DEVICE_ID_VENDOR: 2197 setVendor((String)value); 2198 break; 2199 case FL_DEVICE_ID_MANUFACTURER: 2200 setManufacturer((String)value); 2201 break; 2202 case FL_DEVICE_ID_MADE_DATE: 2203 setMadeDate((java.util.Date)value); 2204 break; 2205 case FL_DEVICE_ID_VERSION: 2206 setVersion((String)value); 2207 break; 2208 case FL_DEVICE_ID_USED_SDKS: 2209 setUsedSdks((String)value); 2210 break; 2211 case FL_DEVICE_ID_SERIAL_NO: 2212 setSerialNo((String)value); 2213 break; 2214 case FL_DEVICE_ID_MAC: 2215 setMac((String)value); 2216 break; 2217 case FL_DEVICE_ID_DIRECTION: 2218 setDirection((Integer)value); 2219 break; 2220 case FL_DEVICE_ID_REMARK: 2221 setRemark((String)value); 2222 break; 2223 case FL_DEVICE_ID_EXT_BIN: 2224 setExtBin((java.nio.ByteBuffer)value); 2225 break; 2226 case FL_DEVICE_ID_EXT_TXT: 2227 setExtTxt((String)value); 2228 break; 2229 case FL_DEVICE_ID_CREATE_TIME: 2230 setCreateTime((java.util.Date)value); 2231 break; 2232 case FL_DEVICE_ID_UPDATE_TIME: 2233 setUpdateTime((java.util.Date)value); 2234 break; 2235 default: 2236 break; 2237 } 2238 } 2239 2240 @Override 2241 public <T> T getValue(String column) 2242 { 2243 return getValue(columnIDOf(column)); 2244 } 2245 2246 @Override 2247 public <T> void setValue(String column,T value) 2248 { 2249 setValue(columnIDOf(column),value); 2250 } 2251 2252 /** 2253 * @param column column name 2254 * @return column id for the given field name or negative if {@code column} is invalid name 2255 */ 2256 public static int columnIDOf(String column){ 2257 int index = FL_DEVICE_FIELDS_LIST.indexOf(column); 2258 return index < 0 2259 ? FL_DEVICE_JAVA_FIELDS_LIST.indexOf(column) 2260 : index; 2261 } 2262 2263 public static String columnNameOf(int columnId){ 2264 try{ 2265 return FL_DEVICE_FIELDS_LIST.get(columnId); 2266 } catch(IndexOutOfBoundsException e){ 2267 return null; 2268 } 2269 } 2270 2271 public static Class<?> typeOf(int columnId){ 2272 try{ 2273 return FL_DEVICE_FIELD_TYPES[columnId]; 2274 } catch(IndexOutOfBoundsException e){ 2275 return null; 2276 } 2277 } 2278 2279 public static final Builder builder(){ 2280 return new Builder().reset(); 2281 } 2282 /** 2283 * a builder for DeviceBean,the template instance is thread local variable 2284 * a instance of Builder can be reused. 2285 */ 2286 public static final class Builder{ 2287 /** DeviceBean instance used for template to create new DeviceBean instance. */ 2288 static final ThreadLocal<DeviceBean> TEMPLATE = new ThreadLocal<DeviceBean>(){ 2289 @Override 2290 protected DeviceBean initialValue() { 2291 return new DeviceBean(); 2292 }}; 2293 private Builder() {} 2294 /** 2295 * reset the bean as template 2296 * @see DeviceBean#reset() 2297 */ 2298 public Builder reset(){ 2299 TEMPLATE.get().reset(); 2300 return this; 2301 } 2302 /** set a bean as template,must not be {@code null} */ 2303 public Builder template(DeviceBean bean){ 2304 if(null == bean){ 2305 throw new NullPointerException(); 2306 } 2307 TEMPLATE.set(bean); 2308 return this; 2309 } 2310 /** return a clone instance of {@link #TEMPLATE}*/ 2311 public DeviceBean build(){ 2312 return TEMPLATE.get().clone(); 2313 } 2314 /** 2315 * fill the field : fl_device.id 2316 * @param id 设备id 2317 * @see DeviceBean#getId() 2318 * @see DeviceBean#setId(Integer) 2319 */ 2320 public Builder id(Integer id){ 2321 TEMPLATE.get().setId(id); 2322 return this; 2323 } 2324 /** 2325 * fill the field : fl_device.group_id 2326 * @param groupId 所属设备组id 2327 * @see DeviceBean#getGroupId() 2328 * @see DeviceBean#setGroupId(Integer) 2329 */ 2330 public Builder groupId(Integer groupId){ 2331 TEMPLATE.get().setGroupId(groupId); 2332 return this; 2333 } 2334 /** 2335 * fill the field : fl_device.name 2336 * @param name 设备名称 2337 * @see DeviceBean#getName() 2338 * @see DeviceBean#setName(String) 2339 */ 2340 public Builder name(String name){ 2341 TEMPLATE.get().setName(name); 2342 return this; 2343 } 2344 /** 2345 * fill the field : fl_device.product_name 2346 * @param productName 产品名称 2347 * @see DeviceBean#getProductName() 2348 * @see DeviceBean#setProductName(String) 2349 */ 2350 public Builder productName(String productName){ 2351 TEMPLATE.get().setProductName(productName); 2352 return this; 2353 } 2354 /** 2355 * fill the field : fl_device.model 2356 * @param model 设备型号 2357 * @see DeviceBean#getModel() 2358 * @see DeviceBean#setModel(String) 2359 */ 2360 public Builder model(String model){ 2361 TEMPLATE.get().setModel(model); 2362 return this; 2363 } 2364 /** 2365 * fill the field : fl_device.vendor 2366 * @param vendor 设备供应商 2367 * @see DeviceBean#getVendor() 2368 * @see DeviceBean#setVendor(String) 2369 */ 2370 public Builder vendor(String vendor){ 2371 TEMPLATE.get().setVendor(vendor); 2372 return this; 2373 } 2374 /** 2375 * fill the field : fl_device.manufacturer 2376 * @param manufacturer 设备制造商 2377 * @see DeviceBean#getManufacturer() 2378 * @see DeviceBean#setManufacturer(String) 2379 */ 2380 public Builder manufacturer(String manufacturer){ 2381 TEMPLATE.get().setManufacturer(manufacturer); 2382 return this; 2383 } 2384 /** 2385 * fill the field : fl_device.made_date 2386 * @param madeDate 设备生产日期 2387 * @see DeviceBean#getMadeDate() 2388 * @see DeviceBean#setMadeDate(java.util.Date) 2389 */ 2390 public Builder madeDate(java.util.Date madeDate){ 2391 TEMPLATE.get().setMadeDate(madeDate); 2392 return this; 2393 } 2394 /** 2395 * fill the field : fl_device.version 2396 * @param version 设备版本号 2397 * @see DeviceBean#getVersion() 2398 * @see DeviceBean#setVersion(String) 2399 */ 2400 public Builder version(String version){ 2401 TEMPLATE.get().setVersion(version); 2402 return this; 2403 } 2404 /** 2405 * fill the field : fl_device.used_sdks 2406 * @param usedSdks 支持的特征码(算法)版本号列表(逗号分隔),特征版本号用于区分不同人脸识别算法生成的特征数据(SDK版本号命名允许字母,数字,-,.,_符号) 2407 * @see DeviceBean#getUsedSdks() 2408 * @see DeviceBean#setUsedSdks(String) 2409 */ 2410 public Builder usedSdks(String usedSdks){ 2411 TEMPLATE.get().setUsedSdks(usedSdks); 2412 return this; 2413 } 2414 /** 2415 * fill the field : fl_device.serial_no 2416 * @param serialNo 设备序列号 2417 * @see DeviceBean#getSerialNo() 2418 * @see DeviceBean#setSerialNo(String) 2419 */ 2420 public Builder serialNo(String serialNo){ 2421 TEMPLATE.get().setSerialNo(serialNo); 2422 return this; 2423 } 2424 /** 2425 * fill the field : fl_device.mac 2426 * @param mac 6字节MAC地址(HEX) 2427 * @see DeviceBean#getMac() 2428 * @see DeviceBean#setMac(String) 2429 */ 2430 public Builder mac(String mac){ 2431 TEMPLATE.get().setMac(mac); 2432 return this; 2433 } 2434 /** 2435 * fill the field : fl_device.direction 2436 * @param direction 通行方向,NULL,0:入口,1:出口,默认0 2437 * @see DeviceBean#getDirection() 2438 * @see DeviceBean#setDirection(Integer) 2439 */ 2440 public Builder direction(Integer direction){ 2441 TEMPLATE.get().setDirection(direction); 2442 return this; 2443 } 2444 /** 2445 * fill the field : fl_device.remark 2446 * @param remark 备注 2447 * @see DeviceBean#getRemark() 2448 * @see DeviceBean#setRemark(String) 2449 */ 2450 public Builder remark(String remark){ 2451 TEMPLATE.get().setRemark(remark); 2452 return this; 2453 } 2454 /** 2455 * fill the field : fl_device.ext_bin 2456 * @param extBin 应用项目自定义二进制扩展字段(最大64KB) 2457 * @see DeviceBean#getExtBin() 2458 * @see DeviceBean#setExtBin(java.nio.ByteBuffer) 2459 */ 2460 public Builder extBin(java.nio.ByteBuffer extBin){ 2461 TEMPLATE.get().setExtBin(extBin); 2462 return this; 2463 } 2464 /** 2465 * fill the field : fl_device.ext_txt 2466 * @param extTxt 应用项目自定义文本扩展字段(最大64KB) 2467 * @see DeviceBean#getExtTxt() 2468 * @see DeviceBean#setExtTxt(String) 2469 */ 2470 public Builder extTxt(String extTxt){ 2471 TEMPLATE.get().setExtTxt(extTxt); 2472 return this; 2473 } 2474 /** 2475 * fill the field : fl_device.create_time 2476 * @param createTime 2477 * @see DeviceBean#getCreateTime() 2478 * @see DeviceBean#setCreateTime(java.util.Date) 2479 */ 2480 public Builder createTime(java.util.Date createTime){ 2481 TEMPLATE.get().setCreateTime(createTime); 2482 return this; 2483 } 2484 /** 2485 * fill the field : fl_device.update_time 2486 * @param updateTime 2487 * @see DeviceBean#getUpdateTime() 2488 * @see DeviceBean#setUpdateTime(java.util.Date) 2489 */ 2490 public Builder updateTime(java.util.Date updateTime){ 2491 TEMPLATE.get().setUpdateTime(updateTime); 2492 return this; 2493 } 2494 } 2495}