Beispiel #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, Type struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetTypes()) {
     optionals.set(0);
   }
   if (struct.isSetRoot()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetTypes()) {
     {
       oprot.writeI32(struct.types.size());
       for (Map.Entry<Integer, Typ> _iter5 : struct.types.entrySet()) {
         oprot.writeI32(_iter5.getKey());
         _iter5.getValue().write(oprot);
       }
     }
   }
   if (struct.isSetRoot()) {
     oprot.writeI32(struct.root);
   }
 }
Beispiel #2
0
  public int compareTo(Type other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    lastComparison = Boolean.valueOf(isSetTypes()).compareTo(typedOther.isSetTypes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTypes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.types, typedOther.types);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRoot()).compareTo(typedOther.isSetRoot());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRoot()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.root, typedOther.root);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Beispiel #3
0
  public boolean equals(Type that) {
    if (that == null) return false;

    boolean this_present_types = true && this.isSetTypes();
    boolean that_present_types = true && that.isSetTypes();
    if (this_present_types || that_present_types) {
      if (!(this_present_types && that_present_types)) return false;
      if (!this.types.equals(that.types)) return false;
    }

    boolean this_present_root = true;
    boolean that_present_root = true;
    if (this_present_root || that_present_root) {
      if (!(this_present_root && that_present_root)) return false;
      if (this.root != that.root) return false;
    }

    return true;
  }
Beispiel #4
0
  /** Performs a deep copy on <i>other</i>. */
  public Type(Type other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetTypes()) {
      Map<Integer, Typ> __this__types = new HashMap<Integer, Typ>();
      for (Map.Entry<Integer, Typ> other_element : other.types.entrySet()) {

        Integer other_element_key = other_element.getKey();
        Typ other_element_value = other_element.getValue();

        Integer __this__types_copy_key = other_element_key;

        Typ __this__types_copy_value = new Typ(other_element_value);

        __this__types.put(__this__types_copy_key, __this__types_copy_value);
      }
      this.types = __this__types;
    }
    this.root = other.root;
  }