@Override
 public void clear() {
   setHasfullImageIsSet(false);
   this.hasfullImage = false;
   setSeqNumIsSet(false);
   this.seqNum = 0;
   this.privilegeChanges = null;
   this.roleChanges = null;
 }
 public TPermissionsUpdate(
     boolean hasfullImage,
     long seqNum,
     Map<String, TPrivilegeChanges> privilegeChanges,
     Map<String, TRoleChanges> roleChanges) {
   this();
   this.hasfullImage = hasfullImage;
   setHasfullImageIsSet(true);
   this.seqNum = seqNum;
   setSeqNumIsSet(true);
   this.privilegeChanges = privilegeChanges;
   this.roleChanges = roleChanges;
 }
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TPermissionsUpdate struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.hasfullImage = iprot.readBool();
   struct.setHasfullImageIsSet(true);
   struct.seqNum = iprot.readI64();
   struct.setSeqNumIsSet(true);
   {
     org.apache.thrift.protocol.TMap _map114 =
         new org.apache.thrift.protocol.TMap(
             org.apache.thrift.protocol.TType.STRING,
             org.apache.thrift.protocol.TType.STRUCT,
             iprot.readI32());
     struct.privilegeChanges = new HashMap<String, TPrivilegeChanges>(2 * _map114.size);
     for (int _i115 = 0; _i115 < _map114.size; ++_i115) {
       String _key116; // required
       TPrivilegeChanges _val117; // required
       _key116 = iprot.readString();
       _val117 = new TPrivilegeChanges();
       _val117.read(iprot);
       struct.privilegeChanges.put(_key116, _val117);
     }
   }
   struct.setPrivilegeChangesIsSet(true);
   {
     org.apache.thrift.protocol.TMap _map118 =
         new org.apache.thrift.protocol.TMap(
             org.apache.thrift.protocol.TType.STRING,
             org.apache.thrift.protocol.TType.STRUCT,
             iprot.readI32());
     struct.roleChanges = new HashMap<String, TRoleChanges>(2 * _map118.size);
     for (int _i119 = 0; _i119 < _map118.size; ++_i119) {
       String _key120; // required
       TRoleChanges _val121; // required
       _key120 = iprot.readString();
       _val121 = new TRoleChanges();
       _val121.read(iprot);
       struct.roleChanges.put(_key120, _val121);
     }
   }
   struct.setRoleChangesIsSet(true);
 }
    public void read(org.apache.thrift.protocol.TProtocol iprot, TPermissionsUpdate struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // HASFULL_IMAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.hasfullImage = iprot.readBool();
              struct.setHasfullImageIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SEQ_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.seqNum = iprot.readI64();
              struct.setSeqNumIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PRIVILEGE_CHANGES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map102 = iprot.readMapBegin();
                struct.privilegeChanges = new HashMap<String, TPrivilegeChanges>(2 * _map102.size);
                for (int _i103 = 0; _i103 < _map102.size; ++_i103) {
                  String _key104; // required
                  TPrivilegeChanges _val105; // required
                  _key104 = iprot.readString();
                  _val105 = new TPrivilegeChanges();
                  _val105.read(iprot);
                  struct.privilegeChanges.put(_key104, _val105);
                }
                iprot.readMapEnd();
              }
              struct.setPrivilegeChangesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // ROLE_CHANGES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map106 = iprot.readMapBegin();
                struct.roleChanges = new HashMap<String, TRoleChanges>(2 * _map106.size);
                for (int _i107 = 0; _i107 < _map106.size; ++_i107) {
                  String _key108; // required
                  TRoleChanges _val109; // required
                  _key108 = iprot.readString();
                  _val109 = new TRoleChanges();
                  _val109.read(iprot);
                  struct.roleChanges.put(_key108, _val109);
                }
                iprot.readMapEnd();
              }
              struct.setRoleChangesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetHasfullImage()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'hasfullImage' was not found in serialized data! Struct: "
                + toString());
      }
      if (!struct.isSetSeqNum()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'seqNum' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }
 public TPermissionsUpdate setSeqNum(long seqNum) {
   this.seqNum = seqNum;
   setSeqNumIsSet(true);
   return this;
 }