예제 #1
0
  @Override
  public int compareTo(TI16Column other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValues()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNulls()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #2
0
 /** Performs a deep copy on <i>other</i>. */
 public TI16Column(TI16Column other) {
   if (other.isSetValues()) {
     List<Short> __this__values = new ArrayList<Short>(other.values);
     this.values = __this__values;
   }
   if (other.isSetNulls()) {
     this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls);
     ;
   }
 }
예제 #3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Column struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.values != null) {
        oprot.writeFieldBegin(VALUES_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.I16, struct.values.size()));
          for (short _iter73 : struct.values) {
            oprot.writeI16(_iter73);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.nulls != null) {
        oprot.writeFieldBegin(NULLS_FIELD_DESC);
        oprot.writeBinary(struct.nulls);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
예제 #4
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column 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: // VALUES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list70 = iprot.readListBegin();
                struct.values = new ArrayList<Short>(_list70.size);
                for (int _i71 = 0; _i71 < _list70.size; ++_i71) {
                  short _elem72;
                  _elem72 = iprot.readI16();
                  struct.values.add(_elem72);
                }
                iprot.readListEnd();
              }
              struct.setValuesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NULLS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.nulls = iprot.readBinary();
              struct.setNullsIsSet(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
      struct.validate();
    }
예제 #5
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   {
     org.apache.thrift.protocol.TList _list75 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.I16, iprot.readI32());
     struct.values = new ArrayList<Short>(_list75.size);
     for (int _i76 = 0; _i76 < _list75.size; ++_i76) {
       short _elem77;
       _elem77 = iprot.readI16();
       struct.values.add(_elem77);
     }
   }
   struct.setValuesIsSet(true);
   struct.nulls = iprot.readBinary();
   struct.setNullsIsSet(true);
 }
예제 #6
0
  public boolean equals(TI16Column that) {
    if (that == null) return false;

    boolean this_present_values = true && this.isSetValues();
    boolean that_present_values = true && that.isSetValues();
    if (this_present_values || that_present_values) {
      if (!(this_present_values && that_present_values)) return false;
      if (!this.values.equals(that.values)) return false;
    }

    boolean this_present_nulls = true && this.isSetNulls();
    boolean that_present_nulls = true && that.isSetNulls();
    if (this_present_nulls || that_present_nulls) {
      if (!(this_present_nulls && that_present_nulls)) return false;
      if (!this.nulls.equals(that.nulls)) return false;
    }

    return true;
  }