All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.gdface.facelog.db.PersonGroupBean Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
// ______________________________________________________
// Generated by sql2java - https://github.com/10km/sql2java 
// JDBC driver used at code generation time: com.mysql.jdbc.Driver
// template: bean.java.vm
// ______________________________________________________
package net.gdface.facelog.db;
import java.io.Serializable;
import java.util.Objects;

import gu.sql2java.BaseRow;

import com.facebook.swift.codec.ThriftStruct;
import com.facebook.swift.codec.ThriftField;
import com.facebook.swift.codec.ThriftField.Requiredness;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonIgnore;
import net.gdface.annotation.CodegenLength;
import net.gdface.annotation.CodegenRequired;
import net.gdface.annotation.CodegenInvalidValue;
/**
 * PersonGroupBean is a mapping of fl_person_group Table.
 * 
Meta Data Information (in progress): *
    *
  • comments: 用户组信息
  • *
* @author guyadong */ @ThriftStruct @ApiModel(description="用户组信息") public final class PersonGroupBean extends BaseRow implements Serializable,Constant { private static final long serialVersionUID = 4644637718755569065L; /** comments:用户组id */ @ApiModelProperty(value = "用户组id" ,required=true ,dataType="Integer") @CodegenRequired@CodegenInvalidValue("0") private Integer id; /** comments:用户组名 */ @ApiModelProperty(value = "用户组名" ,required=true ,dataType="String") @CodegenLength(max=32,prealloc=true)@CodegenRequired@CodegenInvalidValue private String name; /** comments:是否为叶子节点, 1:叶子节点 0:分支节点,null:两者都可 */ @ApiModelProperty(value = "是否为叶子节点, 1:叶子节点 0:分支节点,null:两者都可" ,dataType="Integer") @CodegenInvalidValue("-1") private Integer leaf; /** comments:上一级用户组id */ @ApiModelProperty(value = "上一级用户组id" ,dataType="Integer") @CodegenInvalidValue("0") private Integer parent; /** comments:指向设备组id,用于应用层定义管理员/操作员的管理边界,此字段不为null代表此用户组为管理边界,指向的设备组为此用户组的设备管理边界, 对于属于此组的管理员和操作员都只能管理此组内的用户及对应设备组内的设备 */ @ApiModelProperty(value = "指向设备组id,用于应用层定义管理员/操作员的管理边界,此字段不为null代表此用户组为管理边界,指向的设备组为此用户组的设备管理边界, 对于属于此组的管理员和操作员都只能管理此组内的用户及对应设备组内的设备" ,dataType="Integer") @CodegenInvalidValue("-1") private Integer rootGroup; /** comments:备注 */ @ApiModelProperty(value = "备注" ,dataType="String") @CodegenLength(max=256)@CodegenInvalidValue private String remark; /** comments:应用项目自定义二进制扩展字段(最大64KB) */ @ApiModelProperty(value = "应用项目自定义二进制扩展字段(最大64KB)" ,dataType="ByteBuffer") @CodegenLength(max=65535)@CodegenInvalidValue private java.nio.ByteBuffer extBin; /** comments:应用项目自定义文本扩展字段(最大64KB) */ @ApiModelProperty(value = "应用项目自定义文本扩展字段(最大64KB)" ,dataType="String") @CodegenLength(max=65535)@CodegenInvalidValue private String extTxt; @ApiModelProperty(value = "create_time" ,dataType="Date") @CodegenInvalidValue("0") private java.util.Date createTime; @ApiModelProperty(value = "update_time" ,dataType="Date") @CodegenInvalidValue("0") private java.util.Date updateTime; /** columns modified flag */ @ApiModelProperty(value="columns modified flag",dataType="int",required=true) private int modified; /** columns initialized flag */ @ApiModelProperty(value="columns initialized flag",dataType="int",required=true) private int initialized; /** new record flag */ @ApiModelProperty(value="new record flag",dataType="boolean",required=true) private boolean isNew; @ThriftField(value=1,name="_new",requiredness=Requiredness.REQUIRED) @Override public boolean isNew() { return this.isNew; } /** * Specifies to the object if it has been set as new. * * @param isNew the boolean value to be assigned to the isNew field */ @ThriftField() @Override public void setNew(boolean isNew) { this.isNew = isNew; } /** * @return the modified status of columns */ @ThriftField(value=2,requiredness=Requiredness.REQUIRED) @Override public int getModified(){ return modified; } /** * @param modified the modified status bit to be assigned to {@link #modified} */ @ThriftField() @Override public void setModified(int modified){ this.modified = modified; } /** * @return the initialized status of columns */ @ThriftField(value=3,requiredness=Requiredness.REQUIRED) @Override public int getInitialized(){ return initialized; } /** * @param initialized the initialized status bit to be assigned to {@link #initialized} */ @ThriftField() @Override public void setInitialized(int initialized){ this.initialized = initialized; } public PersonGroupBean(){ reset(); } /** * construct a new instance filled with primary keys * @param id PK# 1 */ public PersonGroupBean(Integer id){ setId(id); } /** * Getter method for {@link #id}.
* PRIMARY KEY.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.id
  • *
  • imported key: fl_permit.person_group_id
  • *
  • imported key: fl_person.group_id
  • *
  • imported key: fl_person_group.parent
  • *
  • comments: 用户组id
  • *
  • AUTO_INCREMENT
  • *
  • NOT NULL
  • *
  • column size: 10
  • *
  • JDBC type returned by the driver: Types.INTEGER
  • *
* * @return the value of id */ @ThriftField(value=4) @JsonProperty("id") public Integer getId(){ return id; } /** * Setter method for {@link #id}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value to be assigned to id */ @ThriftField(name="id") @JsonProperty("id") public void setId(Integer newVal) { modified |= FL_PERSON_GROUP_ID_ID_MASK; initialized |= FL_PERSON_GROUP_ID_ID_MASK; if (Objects.equals(newVal, id)) { return; } id = newVal; } /** * Setter method for {@link #id}.
* Convenient for those who do not want to deal with Objects for primary types. * * @param newVal the new value to be assigned to id */ @JsonIgnore public void setId(int newVal) { setId(new Integer(newVal)); } /** * Determines if the id has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkIdModified() { return 0 != (modified & FL_PERSON_GROUP_ID_ID_MASK); } /** * Determines if the id has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkIdInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_ID_MASK); } /** * Getter method for {@link #name}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.name
  • *
  • comments: 用户组名
  • *
  • NOT NULL
  • *
  • column size: 32
  • *
  • JDBC type returned by the driver: Types.VARCHAR
  • *
* * @return the value of name */ @ThriftField(value=5) @JsonProperty("name") public String getName(){ return name; } /** * Setter method for {@link #name}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value( NOT NULL) to be assigned to name */ @ThriftField(name="name") @JsonProperty("name") public void setName(String newVal) { modified |= FL_PERSON_GROUP_ID_NAME_MASK; initialized |= FL_PERSON_GROUP_ID_NAME_MASK; if (Objects.equals(newVal, name)) { return; } name = newVal; } /** * Determines if the name has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkNameModified() { return 0 != (modified & FL_PERSON_GROUP_ID_NAME_MASK); } /** * Determines if the name has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkNameInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_NAME_MASK); } /** * Getter method for {@link #leaf}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.leaf
  • *
  • comments: 是否为叶子节点, 1:叶子节点 0:分支节点,null:两者都可
  • *
  • column size: 3
  • *
  • JDBC type returned by the driver: Types.TINYINT
  • *
* * @return the value of leaf */ @ThriftField(value=6) @JsonProperty("leaf") public Integer getLeaf(){ return leaf; } /** * Setter method for {@link #leaf}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value to be assigned to leaf */ @ThriftField(name="leaf") @JsonProperty("leaf") public void setLeaf(Integer newVal) { modified |= FL_PERSON_GROUP_ID_LEAF_MASK; initialized |= FL_PERSON_GROUP_ID_LEAF_MASK; if (Objects.equals(newVal, leaf)) { return; } leaf = newVal; } /** * Setter method for {@link #leaf}.
* Convenient for those who do not want to deal with Objects for primary types. * * @param newVal the new value to be assigned to leaf */ @JsonIgnore public void setLeaf(int newVal) { setLeaf(new Integer(newVal)); } /** * Determines if the leaf has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkLeafModified() { return 0 != (modified & FL_PERSON_GROUP_ID_LEAF_MASK); } /** * Determines if the leaf has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkLeafInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_LEAF_MASK); } /** * Getter method for {@link #parent}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.parent
  • *
  • foreign key: fl_person_group.id
  • *
  • comments: 上一级用户组id
  • *
  • column size: 10
  • *
  • JDBC type returned by the driver: Types.INTEGER
  • *
* * @return the value of parent */ @ThriftField(value=7) @JsonProperty("parent") public Integer getParent(){ return parent; } /** * Setter method for {@link #parent}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value to be assigned to parent */ @ThriftField(name="parent") @JsonProperty("parent") public void setParent(Integer newVal) { modified |= FL_PERSON_GROUP_ID_PARENT_MASK; initialized |= FL_PERSON_GROUP_ID_PARENT_MASK; if (Objects.equals(newVal, parent)) { return; } parent = newVal; } /** * Setter method for {@link #parent}.
* Convenient for those who do not want to deal with Objects for primary types. * * @param newVal the new value to be assigned to parent */ @JsonIgnore public void setParent(int newVal) { setParent(new Integer(newVal)); } /** * Determines if the parent has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkParentModified() { return 0 != (modified & FL_PERSON_GROUP_ID_PARENT_MASK); } /** * Determines if the parent has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkParentInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_PARENT_MASK); } /** * Getter method for {@link #rootGroup}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.root_group
  • *
  • comments: 指向设备组id,用于应用层定义管理员/操作员的管理边界,此字段不为null代表此用户组为管理边界,指向的设备组为此用户组的设备管理边界, 对于属于此组的管理员和操作员都只能管理此组内的用户及对应设备组内的设备
  • *
  • column size: 10
  • *
  • JDBC type returned by the driver: Types.INTEGER
  • *
* * @return the value of rootGroup */ @ThriftField(value=8) @JsonProperty("rootGroup") public Integer getRootGroup(){ return rootGroup; } /** * Setter method for {@link #rootGroup}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value to be assigned to rootGroup */ @ThriftField(name="rootGroup") @JsonProperty("rootGroup") public void setRootGroup(Integer newVal) { modified |= FL_PERSON_GROUP_ID_ROOT_GROUP_MASK; initialized |= FL_PERSON_GROUP_ID_ROOT_GROUP_MASK; if (Objects.equals(newVal, rootGroup)) { return; } rootGroup = newVal; } /** * Setter method for {@link #rootGroup}.
* Convenient for those who do not want to deal with Objects for primary types. * * @param newVal the new value to be assigned to rootGroup */ @JsonIgnore public void setRootGroup(int newVal) { setRootGroup(new Integer(newVal)); } /** * Determines if the rootGroup has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkRootGroupModified() { return 0 != (modified & FL_PERSON_GROUP_ID_ROOT_GROUP_MASK); } /** * Determines if the rootGroup has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkRootGroupInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_ROOT_GROUP_MASK); } /** * Getter method for {@link #remark}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.remark
  • *
  • comments: 备注
  • *
  • column size: 256
  • *
  • JDBC type returned by the driver: Types.VARCHAR
  • *
* * @return the value of remark */ @ThriftField(value=9) @JsonProperty("remark") public String getRemark(){ return remark; } /** * Setter method for {@link #remark}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value to be assigned to remark */ @ThriftField(name="remark") @JsonProperty("remark") public void setRemark(String newVal) { modified |= FL_PERSON_GROUP_ID_REMARK_MASK; initialized |= FL_PERSON_GROUP_ID_REMARK_MASK; if (Objects.equals(newVal, remark)) { return; } remark = newVal; } /** * Determines if the remark has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkRemarkModified() { return 0 != (modified & FL_PERSON_GROUP_ID_REMARK_MASK); } /** * Determines if the remark has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkRemarkInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_REMARK_MASK); } /** * Getter method for {@link #extBin}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.ext_bin
  • *
  • comments: 应用项目自定义二进制扩展字段(最大64KB)
  • *
  • column size: 65535
  • *
  • JDBC type returned by the driver: Types.LONGVARBINARY
  • *
* * @return the value of extBin */ @ThriftField(value=10) @JsonProperty("extBin") public java.nio.ByteBuffer getExtBin(){ return extBin; } /** * Setter method for {@link #extBin}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value to be assigned to extBin */ @ThriftField(name="extBin") @JsonProperty("extBin") public void setExtBin(java.nio.ByteBuffer newVal) { modified |= FL_PERSON_GROUP_ID_EXT_BIN_MASK; initialized |= FL_PERSON_GROUP_ID_EXT_BIN_MASK; if (Objects.equals(newVal, extBin)) { return; } extBin = newVal; } /** * Determines if the extBin has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkExtBinModified() { return 0 != (modified & FL_PERSON_GROUP_ID_EXT_BIN_MASK); } /** * Determines if the extBin has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkExtBinInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_EXT_BIN_MASK); } /** * Getter method for {@link #extTxt}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.ext_txt
  • *
  • comments: 应用项目自定义文本扩展字段(最大64KB)
  • *
  • column size: 65535
  • *
  • JDBC type returned by the driver: Types.LONGVARCHAR
  • *
* * @return the value of extTxt */ @ThriftField(value=11) @JsonProperty("extTxt") public String getExtTxt(){ return extTxt; } /** * Setter method for {@link #extTxt}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value to be assigned to extTxt */ @ThriftField(name="extTxt") @JsonProperty("extTxt") public void setExtTxt(String newVal) { modified |= FL_PERSON_GROUP_ID_EXT_TXT_MASK; initialized |= FL_PERSON_GROUP_ID_EXT_TXT_MASK; if (Objects.equals(newVal, extTxt)) { return; } extTxt = newVal; } /** * Determines if the extTxt has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkExtTxtModified() { return 0 != (modified & FL_PERSON_GROUP_ID_EXT_TXT_MASK); } /** * Determines if the extTxt has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkExtTxtInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_EXT_TXT_MASK); } /** * Getter method for {@link #createTime}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.create_time
  • *
  • default value: 'CURRENT_TIMESTAMP'
  • *
  • NOT NULL
  • *
  • column size: 19
  • *
  • JDBC type returned by the driver: Types.TIMESTAMP
  • *
* * @return the value of createTime */ @JsonIgnore public java.util.Date getCreateTime(){ return createTime; } /** * use Long to represent date type for thrift:swift support * @see #getCreateTime() */ @ThriftField(value=12,name="createTime") @JsonProperty("createTime") public Long readCreateTime(){ return null == createTime ? null:createTime.getTime(); } /** * Setter method for {@link #createTime}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value( NOT NULL) to be assigned to createTime */ @JsonIgnore public void setCreateTime(java.util.Date newVal) { modified |= FL_PERSON_GROUP_ID_CREATE_TIME_MASK; initialized |= FL_PERSON_GROUP_ID_CREATE_TIME_MASK; if (Objects.equals(newVal, createTime)) { return; } createTime = newVal; } /** * setter for thrift:swift OR jackson support
* without modification for {@link #modified} and {@link #initialized}
* NOTE:DO NOT use the method in your code */ @ThriftField(name="createTime") @JsonProperty("createTime") public void writeCreateTime(Long newVal){ setCreateTime(null == newVal?null:new java.util.Date(newVal)); } /** * Setter method for {@link #createTime}.
* Convenient for those who do not want to deal with Objects for primary types. * * @param newVal the new value to be assigned to createTime */ @JsonIgnore public void setCreateTime(long newVal) { setCreateTime(new java.util.Date(newVal)); } /** * Setter method for {@link #createTime}.
* @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. */ @JsonIgnore public void setCreateTime(Long newVal) { setCreateTime(null == newVal ? null : new java.util.Date(newVal)); } /** * Determines if the createTime has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkCreateTimeModified() { return 0 != (modified & FL_PERSON_GROUP_ID_CREATE_TIME_MASK); } /** * Determines if the createTime has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkCreateTimeInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_CREATE_TIME_MASK); } /** * Getter method for {@link #updateTime}.
* Meta Data Information (in progress): *
    *
  • full name: fl_person_group.update_time
  • *
  • default value: 'CURRENT_TIMESTAMP'
  • *
  • NOT NULL
  • *
  • column size: 19
  • *
  • JDBC type returned by the driver: Types.TIMESTAMP
  • *
* * @return the value of updateTime */ @JsonIgnore public java.util.Date getUpdateTime(){ return updateTime; } /** * use Long to represent date type for thrift:swift support * @see #getUpdateTime() */ @ThriftField(value=13,name="updateTime") @JsonProperty("updateTime") public Long readUpdateTime(){ return null == updateTime ? null:updateTime.getTime(); } /** * Setter method for {@link #updateTime}.
* The new value is set only if equals() says it is different, * or if one of either the new value or the current value is null. * In case the new value is different, it is set and the field is marked as 'modified'. * * @param newVal the new value( NOT NULL) to be assigned to updateTime */ @JsonIgnore public void setUpdateTime(java.util.Date newVal) { modified |= FL_PERSON_GROUP_ID_UPDATE_TIME_MASK; initialized |= FL_PERSON_GROUP_ID_UPDATE_TIME_MASK; if (Objects.equals(newVal, updateTime)) { return; } updateTime = newVal; } /** * setter for thrift:swift OR jackson support
* without modification for {@link #modified} and {@link #initialized}
* NOTE:DO NOT use the method in your code */ @ThriftField(name="updateTime") @JsonProperty("updateTime") public void writeUpdateTime(Long newVal){ setUpdateTime(null == newVal?null:new java.util.Date(newVal)); } /** * Setter method for {@link #updateTime}.
* Convenient for those who do not want to deal with Objects for primary types. * * @param newVal the new value to be assigned to updateTime */ @JsonIgnore public void setUpdateTime(long newVal) { setUpdateTime(new java.util.Date(newVal)); } /** * Setter method for {@link #updateTime}.
* @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. */ @JsonIgnore public void setUpdateTime(Long newVal) { setUpdateTime(null == newVal ? null : new java.util.Date(newVal)); } /** * Determines if the updateTime has been modified. * * @return true if the field has been modified, false if the field has not been modified */ public boolean checkUpdateTimeModified() { return 0 != (modified & FL_PERSON_GROUP_ID_UPDATE_TIME_MASK); } /** * Determines if the updateTime has been initialized.
* * It is useful to determine if a field is null on purpose or just because it has not been initialized. * * @return true if the field has been initialized, false otherwise */ public boolean checkUpdateTimeInitialized() { return 0 != (initialized & FL_PERSON_GROUP_ID_UPDATE_TIME_MASK); } @Override public boolean beModified() { return 0 != modified; } @Override public boolean isModified(int columnID){ return columnID>=0 && columnID < metaData.columnCount && 0 != (modified & (1 << columnID)); } @Override public boolean isInitialized(int columnID){ return columnID>=0 && columnID < metaData.columnCount && 0 != (initialized & (1 << columnID)); } @Override public void resetIsModified() { modified = 0; } @Override public void resetPrimaryKeysModified() { modified &= (~(FL_PERSON_GROUP_ID_ID_MASK)); } /** * Resets columns modification status except primary keys to 'not modified'. */ public void resetModifiedExceptPrimaryKeys() { modified &= (~(FL_PERSON_GROUP_ID_NAME_MASK | FL_PERSON_GROUP_ID_LEAF_MASK | FL_PERSON_GROUP_ID_PARENT_MASK | FL_PERSON_GROUP_ID_ROOT_GROUP_MASK | FL_PERSON_GROUP_ID_REMARK_MASK | FL_PERSON_GROUP_ID_EXT_BIN_MASK | FL_PERSON_GROUP_ID_EXT_TXT_MASK | FL_PERSON_GROUP_ID_CREATE_TIME_MASK | FL_PERSON_GROUP_ID_UPDATE_TIME_MASK)); } /** reset all fields to initial value, equal to a new bean */ public void reset(){ this.id = null; this.name = null; this.leaf = null; this.parent = null; this.rootGroup = null; this.remark = null; this.extBin = null; this.extTxt = null; /* DEFAULT:'CURRENT_TIMESTAMP'*/ this.createTime = null; /* DEFAULT:'CURRENT_TIMESTAMP'*/ this.updateTime = null; this.isNew = true; this.modified = 0; this.initialized = 0; } @Override public PersonGroupBean clone(){ return (PersonGroupBean) super.clone(); } public static final Builder builder(){ return new Builder().reset(); } /** * a builder for PersonGroupBean,the template instance is thread local variable * a instance of Builder can be reused. */ public static final class Builder{ /** PersonGroupBean instance used for template to create new PersonGroupBean instance. */ static final ThreadLocal TEMPLATE = new ThreadLocal(){ @Override protected PersonGroupBean initialValue() { return new PersonGroupBean(); }}; private Builder() {} /** * reset the bean as template * @see PersonGroupBean#reset() */ public Builder reset(){ TEMPLATE.get().reset(); return this; } /** set a bean as template,must not be {@code null} */ public Builder template(PersonGroupBean bean){ if(null == bean){ throw new NullPointerException(); } TEMPLATE.set(bean); return this; } /** return a clone instance of {@link #TEMPLATE}*/ public PersonGroupBean build(){ return TEMPLATE.get().clone(); } /** * fill the field : fl_person_group.id * @param id 用户组id * @see PersonGroupBean#getId() * @see PersonGroupBean#setId(Integer) */ public Builder id(Integer id){ TEMPLATE.get().setId(id); return this; } /** * fill the field : fl_person_group.name * @param name 用户组名 * @see PersonGroupBean#getName() * @see PersonGroupBean#setName(String) */ public Builder name(String name){ TEMPLATE.get().setName(name); return this; } /** * fill the field : fl_person_group.leaf * @param leaf 是否为叶子节点, 1:叶子节点 0:分支节点,null:两者都可 * @see PersonGroupBean#getLeaf() * @see PersonGroupBean#setLeaf(Integer) */ public Builder leaf(Integer leaf){ TEMPLATE.get().setLeaf(leaf); return this; } /** * fill the field : fl_person_group.parent * @param parent 上一级用户组id * @see PersonGroupBean#getParent() * @see PersonGroupBean#setParent(Integer) */ public Builder parent(Integer parent){ TEMPLATE.get().setParent(parent); return this; } /** * fill the field : fl_person_group.root_group * @param rootGroup 指向设备组id,用于应用层定义管理员/操作员的管理边界,此字段不为null代表此用户组为管理边界,指向的设备组为此用户组的设备管理边界, 对于属于此组的管理员和操作员都只能管理此组内的用户及对应设备组内的设备 * @see PersonGroupBean#getRootGroup() * @see PersonGroupBean#setRootGroup(Integer) */ public Builder rootGroup(Integer rootGroup){ TEMPLATE.get().setRootGroup(rootGroup); return this; } /** * fill the field : fl_person_group.remark * @param remark 备注 * @see PersonGroupBean#getRemark() * @see PersonGroupBean#setRemark(String) */ public Builder remark(String remark){ TEMPLATE.get().setRemark(remark); return this; } /** * fill the field : fl_person_group.ext_bin * @param extBin 应用项目自定义二进制扩展字段(最大64KB) * @see PersonGroupBean#getExtBin() * @see PersonGroupBean#setExtBin(java.nio.ByteBuffer) */ public Builder extBin(java.nio.ByteBuffer extBin){ TEMPLATE.get().setExtBin(extBin); return this; } /** * fill the field : fl_person_group.ext_txt * @param extTxt 应用项目自定义文本扩展字段(最大64KB) * @see PersonGroupBean#getExtTxt() * @see PersonGroupBean#setExtTxt(String) */ public Builder extTxt(String extTxt){ TEMPLATE.get().setExtTxt(extTxt); return this; } /** * fill the field : fl_person_group.create_time * @param createTime * @see PersonGroupBean#getCreateTime() * @see PersonGroupBean#setCreateTime(java.util.Date) */ public Builder createTime(java.util.Date createTime){ TEMPLATE.get().setCreateTime(createTime); return this; } /** * fill the field : fl_person_group.update_time * @param updateTime * @see PersonGroupBean#getUpdateTime() * @see PersonGroupBean#setUpdateTime(java.util.Date) */ public Builder updateTime(java.util.Date updateTime){ TEMPLATE.get().setUpdateTime(updateTime); return this; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy