public boolean equals(TPermissionsUpdate that) {
    if (that == null) return false;

    boolean this_present_hasfullImage = true;
    boolean that_present_hasfullImage = true;
    if (this_present_hasfullImage || that_present_hasfullImage) {
      if (!(this_present_hasfullImage && that_present_hasfullImage)) return false;
      if (this.hasfullImage != that.hasfullImage) return false;
    }

    boolean this_present_seqNum = true;
    boolean that_present_seqNum = true;
    if (this_present_seqNum || that_present_seqNum) {
      if (!(this_present_seqNum && that_present_seqNum)) return false;
      if (this.seqNum != that.seqNum) return false;
    }

    boolean this_present_privilegeChanges = true && this.isSetPrivilegeChanges();
    boolean that_present_privilegeChanges = true && that.isSetPrivilegeChanges();
    if (this_present_privilegeChanges || that_present_privilegeChanges) {
      if (!(this_present_privilegeChanges && that_present_privilegeChanges)) return false;
      if (!this.privilegeChanges.equals(that.privilegeChanges)) return false;
    }

    boolean this_present_roleChanges = true && this.isSetRoleChanges();
    boolean that_present_roleChanges = true && that.isSetRoleChanges();
    if (this_present_roleChanges || that_present_roleChanges) {
      if (!(this_present_roleChanges && that_present_roleChanges)) return false;
      if (!this.roleChanges.equals(that.roleChanges)) return false;
    }

    return true;
  }
  public int compareTo(TPermissionsUpdate other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TPermissionsUpdate typedOther = (TPermissionsUpdate) other;

    lastComparison = Boolean.valueOf(isSetHasfullImage()).compareTo(typedOther.isSetHasfullImage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHasfullImage()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.hasfullImage, typedOther.hasfullImage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSeqNum()).compareTo(typedOther.isSetSeqNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSeqNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.seqNum, typedOther.seqNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetPrivilegeChanges()).compareTo(typedOther.isSetPrivilegeChanges());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrivilegeChanges()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.privilegeChanges, typedOther.privilegeChanges);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRoleChanges()).compareTo(typedOther.isSetRoleChanges());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRoleChanges()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.roleChanges, typedOther.roleChanges);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
  /** Performs a deep copy on <i>other</i>. */
  public TPermissionsUpdate(TPermissionsUpdate other) {
    __isset_bitfield = other.__isset_bitfield;
    this.hasfullImage = other.hasfullImage;
    this.seqNum = other.seqNum;
    if (other.isSetPrivilegeChanges()) {
      Map<String, TPrivilegeChanges> __this__privilegeChanges =
          new HashMap<String, TPrivilegeChanges>();
      for (Map.Entry<String, TPrivilegeChanges> other_element : other.privilegeChanges.entrySet()) {

        String other_element_key = other_element.getKey();
        TPrivilegeChanges other_element_value = other_element.getValue();

        String __this__privilegeChanges_copy_key = other_element_key;

        TPrivilegeChanges __this__privilegeChanges_copy_value =
            new TPrivilegeChanges(other_element_value);

        __this__privilegeChanges.put(
            __this__privilegeChanges_copy_key, __this__privilegeChanges_copy_value);
      }
      this.privilegeChanges = __this__privilegeChanges;
    }
    if (other.isSetRoleChanges()) {
      Map<String, TRoleChanges> __this__roleChanges = new HashMap<String, TRoleChanges>();
      for (Map.Entry<String, TRoleChanges> other_element : other.roleChanges.entrySet()) {

        String other_element_key = other_element.getKey();
        TRoleChanges other_element_value = other_element.getValue();

        String __this__roleChanges_copy_key = other_element_key;

        TRoleChanges __this__roleChanges_copy_value = new TRoleChanges(other_element_value);

        __this__roleChanges.put(__this__roleChanges_copy_key, __this__roleChanges_copy_value);
      }
      this.roleChanges = __this__roleChanges;
    }
  }