示例#1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ClusterData struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetClusterName()) {
     optionals.set(0);
   }
   if (struct.isSetGroups()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetClusterName()) {
     oprot.writeString(struct.clusterName);
   }
   if (struct.isSetGroups()) {
     {
       oprot.writeI32(struct.groups.size());
       for (Map.Entry<String, GroupData> _iter13 : struct.groups.entrySet()) {
         oprot.writeString(_iter13.getKey());
         _iter13.getValue().write(oprot);
       }
     }
   }
 }
示例#2
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, ClusterData struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.clusterName != null) {
        if (struct.isSetClusterName()) {
          oprot.writeFieldBegin(CLUSTER_NAME_FIELD_DESC);
          oprot.writeString(struct.clusterName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.groups != null) {
        if (struct.isSetGroups()) {
          oprot.writeFieldBegin(GROUPS_FIELD_DESC);
          {
            oprot.writeMapBegin(
                new org.apache.thrift.protocol.TMap(
                    org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.STRUCT,
                    struct.groups.size()));
            for (Map.Entry<String, GroupData> _iter12 : struct.groups.entrySet()) {
              oprot.writeString(_iter12.getKey());
              _iter12.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
示例#3
0
  public int compareTo(ClusterData other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    lastComparison = Boolean.valueOf(isSetClusterName()).compareTo(typedOther.isSetClusterName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClusterName()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.clusterName, typedOther.clusterName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGroups()).compareTo(typedOther.isSetGroups());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGroups()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groups, typedOther.groups);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
示例#4
0
  public boolean equals(ClusterData that) {
    if (that == null) return false;

    boolean this_present_clusterName = true && this.isSetClusterName();
    boolean that_present_clusterName = true && that.isSetClusterName();
    if (this_present_clusterName || that_present_clusterName) {
      if (!(this_present_clusterName && that_present_clusterName)) return false;
      if (!this.clusterName.equals(that.clusterName)) return false;
    }

    boolean this_present_groups = true && this.isSetGroups();
    boolean that_present_groups = true && that.isSetGroups();
    if (this_present_groups || that_present_groups) {
      if (!(this_present_groups && that_present_groups)) return false;
      if (!this.groups.equals(that.groups)) return false;
    }

    return true;
  }
示例#5
0
  /** Performs a deep copy on <i>other</i>. */
  public ClusterData(ClusterData other) {
    if (other.isSetClusterName()) {
      this.clusterName = other.clusterName;
    }
    if (other.isSetGroups()) {
      Map<String, GroupData> __this__groups = new HashMap<String, GroupData>();
      for (Map.Entry<String, GroupData> other_element : other.groups.entrySet()) {

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

        String __this__groups_copy_key = other_element_key;

        GroupData __this__groups_copy_value = new GroupData(other_element_value);

        __this__groups.put(__this__groups_copy_key, __this__groups_copy_value);
      }
      this.groups = __this__groups;
    }
  }