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

    boolean this_present_protocol_version = true;
    boolean that_present_protocol_version = true;
    if (this_present_protocol_version || that_present_protocol_version) {
      if (!(this_present_protocol_version && that_present_protocol_version)) return false;
      if (this.protocol_version != that.protocol_version) return false;
    }

    boolean this_present_requestorUserName = true && this.isSetRequestorUserName();
    boolean that_present_requestorUserName = true && that.isSetRequestorUserName();
    if (this_present_requestorUserName || that_present_requestorUserName) {
      if (!(this_present_requestorUserName && that_present_requestorUserName)) return false;
      if (!this.requestorUserName.equals(that.requestorUserName)) return false;
    }

    boolean this_present_requestorGroupNames = true && this.isSetRequestorGroupNames();
    boolean that_present_requestorGroupNames = true && that.isSetRequestorGroupNames();
    if (this_present_requestorGroupNames || that_present_requestorGroupNames) {
      if (!(this_present_requestorGroupNames && that_present_requestorGroupNames)) return false;
      if (!this.requestorGroupNames.equals(that.requestorGroupNames)) return false;
    }

    boolean this_present_roleName = true && this.isSetRoleName();
    boolean that_present_roleName = true && that.isSetRoleName();
    if (this_present_roleName || that_present_roleName) {
      if (!(this_present_roleName && that_present_roleName)) return false;
      if (!this.roleName.equals(that.roleName)) return false;
    }

    return true;
  }
 public void read(org.apache.thrift.protocol.TProtocol iprot, TCreateSentryRoleRequest 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: // PROTOCOL_VERSION
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.protocol_version = iprot.readI32();
           struct.setProtocol_versionIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // REQUESTOR_USER_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.requestorUserName = iprot.readString();
           struct.setRequestorUserNameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // REQUESTOR_GROUP_NAMES
         if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
           {
             org.apache.thrift.protocol.TSet _set0 = iprot.readSetBegin();
             struct.requestorGroupNames = new HashSet<String>(2 * _set0.size);
             for (int _i1 = 0; _i1 < _set0.size; ++_i1) {
               String _elem2; // required
               _elem2 = iprot.readString();
               struct.requestorGroupNames.add(_elem2);
             }
             iprot.readSetEnd();
           }
           struct.setRequestorGroupNamesIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // ROLE_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.roleName = iprot.readString();
           struct.setRoleNameIsSet(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();
   struct.validate();
 }
    public void write(org.apache.thrift.protocol.TProtocol oprot, TCreateSentryRoleRequest struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
      oprot.writeI32(struct.protocol_version);
      oprot.writeFieldEnd();
      if (struct.requestorUserName != null) {
        oprot.writeFieldBegin(REQUESTOR_USER_NAME_FIELD_DESC);
        oprot.writeString(struct.requestorUserName);
        oprot.writeFieldEnd();
      }
      if (struct.requestorGroupNames != null) {
        oprot.writeFieldBegin(REQUESTOR_GROUP_NAMES_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.STRING, struct.requestorGroupNames.size()));
          for (String _iter3 : struct.requestorGroupNames) {
            oprot.writeString(_iter3);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.roleName != null) {
        oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC);
        oprot.writeString(struct.roleName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
 /** Performs a deep copy on <i>other</i>. */
 public TCreateSentryRoleRequest(TCreateSentryRoleRequest other) {
   __isset_bitfield = other.__isset_bitfield;
   this.protocol_version = other.protocol_version;
   if (other.isSetRequestorUserName()) {
     this.requestorUserName = other.requestorUserName;
   }
   if (other.isSetRequestorGroupNames()) {
     Set<String> __this__requestorGroupNames = new HashSet<String>();
     for (String other_element : other.requestorGroupNames) {
       __this__requestorGroupNames.add(other_element);
     }
     this.requestorGroupNames = __this__requestorGroupNames;
   }
   if (other.isSetRoleName()) {
     this.roleName = other.roleName;
   }
 }
  public int compareTo(TCreateSentryRoleRequest other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    lastComparison =
        Boolean.valueOf(isSetProtocol_version()).compareTo(typedOther.isSetProtocol_version());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProtocol_version()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.protocol_version, typedOther.protocol_version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetRequestorUserName()).compareTo(typedOther.isSetRequestorUserName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRequestorUserName()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.requestorUserName, typedOther.requestorUserName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetRequestorGroupNames())
            .compareTo(typedOther.isSetRequestorGroupNames());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRequestorGroupNames()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.requestorGroupNames, typedOther.requestorGroupNames);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRoleName()).compareTo(typedOther.isSetRoleName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRoleName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roleName, typedOther.roleName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TCreateSentryRoleRequest struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.protocol_version = iprot.readI32();
   struct.setProtocol_versionIsSet(true);
   struct.requestorUserName = iprot.readString();
   struct.setRequestorUserNameIsSet(true);
   {
     org.apache.thrift.protocol.TSet _set5 =
         new org.apache.thrift.protocol.TSet(
             org.apache.thrift.protocol.TType.STRING, iprot.readI32());
     struct.requestorGroupNames = new HashSet<String>(2 * _set5.size);
     for (int _i6 = 0; _i6 < _set5.size; ++_i6) {
       String _elem7; // required
       _elem7 = iprot.readString();
       struct.requestorGroupNames.add(_elem7);
     }
   }
   struct.setRequestorGroupNamesIsSet(true);
   struct.roleName = iprot.readString();
   struct.setRoleNameIsSet(true);
 }