All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.iotdb.mpp.rpc.thrift.TGroupByTimeParameter Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.iotdb.mpp.rpc.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2024-09-12")
public class TGroupByTimeParameter implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGroupByTimeParameter");

  private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("endTime", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField INTERVAL_FIELD_DESC = new org.apache.thrift.protocol.TField("interval", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField SLIDING_STEP_FIELD_DESC = new org.apache.thrift.protocol.TField("slidingStep", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField INDEXES_FIELD_DESC = new org.apache.thrift.protocol.TField("indexes", org.apache.thrift.protocol.TType.LIST, (short)5);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGroupByTimeParameterStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGroupByTimeParameterTupleSchemeFactory();

  public long startTime; // required
  public long endTime; // required
  public long interval; // required
  public long slidingStep; // required
  public @org.apache.thrift.annotation.Nullable java.util.List indexes; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    START_TIME((short)1, "startTime"),
    END_TIME((short)2, "endTime"),
    INTERVAL((short)3, "interval"),
    SLIDING_STEP((short)4, "slidingStep"),
    INDEXES((short)5, "indexes");

    private static final java.util.Map byName = new java.util.HashMap();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // START_TIME
          return START_TIME;
        case 2: // END_TIME
          return END_TIME;
        case 3: // INTERVAL
          return INTERVAL;
        case 4: // SLIDING_STEP
          return SLIDING_STEP;
        case 5: // INDEXES
          return INDEXES;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __STARTTIME_ISSET_ID = 0;
  private static final int __ENDTIME_ISSET_ID = 1;
  private static final int __INTERVAL_ISSET_ID = 2;
  private static final int __SLIDINGSTEP_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.INDEXES};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.END_TIME, new org.apache.thrift.meta_data.FieldMetaData("endTime", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.INTERVAL, new org.apache.thrift.meta_data.FieldMetaData("interval", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SLIDING_STEP, new org.apache.thrift.meta_data.FieldMetaData("slidingStep", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.INDEXES, new org.apache.thrift.meta_data.FieldMetaData("indexes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGroupByTimeParameter.class, metaDataMap);
  }

  public TGroupByTimeParameter() {
  }

  public TGroupByTimeParameter(
    long startTime,
    long endTime,
    long interval,
    long slidingStep)
  {
    this();
    this.startTime = startTime;
    setStartTimeIsSet(true);
    this.endTime = endTime;
    setEndTimeIsSet(true);
    this.interval = interval;
    setIntervalIsSet(true);
    this.slidingStep = slidingStep;
    setSlidingStepIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public TGroupByTimeParameter(TGroupByTimeParameter other) {
    __isset_bitfield = other.__isset_bitfield;
    this.startTime = other.startTime;
    this.endTime = other.endTime;
    this.interval = other.interval;
    this.slidingStep = other.slidingStep;
    if (other.isSetIndexes()) {
      java.util.List __this__indexes = new java.util.ArrayList(other.indexes);
      this.indexes = __this__indexes;
    }
  }

  public TGroupByTimeParameter deepCopy() {
    return new TGroupByTimeParameter(this);
  }

  @Override
  public void clear() {
    setStartTimeIsSet(false);
    this.startTime = 0;
    setEndTimeIsSet(false);
    this.endTime = 0;
    setIntervalIsSet(false);
    this.interval = 0;
    setSlidingStepIsSet(false);
    this.slidingStep = 0;
    this.indexes = null;
  }

  public long getStartTime() {
    return this.startTime;
  }

  public TGroupByTimeParameter setStartTime(long startTime) {
    this.startTime = startTime;
    setStartTimeIsSet(true);
    return this;
  }

  public void unsetStartTime() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID);
  }

  /** Returns true if field startTime is set (has been assigned a value) and false otherwise */
  public boolean isSetStartTime() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID);
  }

  public void setStartTimeIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value);
  }

  public long getEndTime() {
    return this.endTime;
  }

  public TGroupByTimeParameter setEndTime(long endTime) {
    this.endTime = endTime;
    setEndTimeIsSet(true);
    return this;
  }

  public void unsetEndTime() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID);
  }

  /** Returns true if field endTime is set (has been assigned a value) and false otherwise */
  public boolean isSetEndTime() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID);
  }

  public void setEndTimeIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value);
  }

  public long getInterval() {
    return this.interval;
  }

  public TGroupByTimeParameter setInterval(long interval) {
    this.interval = interval;
    setIntervalIsSet(true);
    return this;
  }

  public void unsetInterval() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INTERVAL_ISSET_ID);
  }

  /** Returns true if field interval is set (has been assigned a value) and false otherwise */
  public boolean isSetInterval() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INTERVAL_ISSET_ID);
  }

  public void setIntervalIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INTERVAL_ISSET_ID, value);
  }

  public long getSlidingStep() {
    return this.slidingStep;
  }

  public TGroupByTimeParameter setSlidingStep(long slidingStep) {
    this.slidingStep = slidingStep;
    setSlidingStepIsSet(true);
    return this;
  }

  public void unsetSlidingStep() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SLIDINGSTEP_ISSET_ID);
  }

  /** Returns true if field slidingStep is set (has been assigned a value) and false otherwise */
  public boolean isSetSlidingStep() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SLIDINGSTEP_ISSET_ID);
  }

  public void setSlidingStepIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SLIDINGSTEP_ISSET_ID, value);
  }

  public int getIndexesSize() {
    return (this.indexes == null) ? 0 : this.indexes.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator getIndexesIterator() {
    return (this.indexes == null) ? null : this.indexes.iterator();
  }

  public void addToIndexes(int elem) {
    if (this.indexes == null) {
      this.indexes = new java.util.ArrayList();
    }
    this.indexes.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List getIndexes() {
    return this.indexes;
  }

  public TGroupByTimeParameter setIndexes(@org.apache.thrift.annotation.Nullable java.util.List indexes) {
    this.indexes = indexes;
    return this;
  }

  public void unsetIndexes() {
    this.indexes = null;
  }

  /** Returns true if field indexes is set (has been assigned a value) and false otherwise */
  public boolean isSetIndexes() {
    return this.indexes != null;
  }

  public void setIndexesIsSet(boolean value) {
    if (!value) {
      this.indexes = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case START_TIME:
      if (value == null) {
        unsetStartTime();
      } else {
        setStartTime((java.lang.Long)value);
      }
      break;

    case END_TIME:
      if (value == null) {
        unsetEndTime();
      } else {
        setEndTime((java.lang.Long)value);
      }
      break;

    case INTERVAL:
      if (value == null) {
        unsetInterval();
      } else {
        setInterval((java.lang.Long)value);
      }
      break;

    case SLIDING_STEP:
      if (value == null) {
        unsetSlidingStep();
      } else {
        setSlidingStep((java.lang.Long)value);
      }
      break;

    case INDEXES:
      if (value == null) {
        unsetIndexes();
      } else {
        setIndexes((java.util.List)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case START_TIME:
      return getStartTime();

    case END_TIME:
      return getEndTime();

    case INTERVAL:
      return getInterval();

    case SLIDING_STEP:
      return getSlidingStep();

    case INDEXES:
      return getIndexes();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case START_TIME:
      return isSetStartTime();
    case END_TIME:
      return isSetEndTime();
    case INTERVAL:
      return isSetInterval();
    case SLIDING_STEP:
      return isSetSlidingStep();
    case INDEXES:
      return isSetIndexes();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TGroupByTimeParameter)
      return this.equals((TGroupByTimeParameter)that);
    return false;
  }

  public boolean equals(TGroupByTimeParameter that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_startTime = true;
    boolean that_present_startTime = true;
    if (this_present_startTime || that_present_startTime) {
      if (!(this_present_startTime && that_present_startTime))
        return false;
      if (this.startTime != that.startTime)
        return false;
    }

    boolean this_present_endTime = true;
    boolean that_present_endTime = true;
    if (this_present_endTime || that_present_endTime) {
      if (!(this_present_endTime && that_present_endTime))
        return false;
      if (this.endTime != that.endTime)
        return false;
    }

    boolean this_present_interval = true;
    boolean that_present_interval = true;
    if (this_present_interval || that_present_interval) {
      if (!(this_present_interval && that_present_interval))
        return false;
      if (this.interval != that.interval)
        return false;
    }

    boolean this_present_slidingStep = true;
    boolean that_present_slidingStep = true;
    if (this_present_slidingStep || that_present_slidingStep) {
      if (!(this_present_slidingStep && that_present_slidingStep))
        return false;
      if (this.slidingStep != that.slidingStep)
        return false;
    }

    boolean this_present_indexes = true && this.isSetIndexes();
    boolean that_present_indexes = true && that.isSetIndexes();
    if (this_present_indexes || that_present_indexes) {
      if (!(this_present_indexes && that_present_indexes))
        return false;
      if (!this.indexes.equals(that.indexes))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTime);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(endTime);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(interval);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(slidingStep);

    hashCode = hashCode * 8191 + ((isSetIndexes()) ? 131071 : 524287);
    if (isSetIndexes())
      hashCode = hashCode * 8191 + indexes.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(TGroupByTimeParameter other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetStartTime(), other.isSetStartTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetEndTime(), other.isSetEndTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEndTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endTime, other.endTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetInterval(), other.isSetInterval());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInterval()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.interval, other.interval);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSlidingStep(), other.isSetSlidingStep());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSlidingStep()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.slidingStep, other.slidingStep);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetIndexes(), other.isSetIndexes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIndexes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.indexes, other.indexes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TGroupByTimeParameter(");
    boolean first = true;

    sb.append("startTime:");
    sb.append(this.startTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("endTime:");
    sb.append(this.endTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("interval:");
    sb.append(this.interval);
    first = false;
    if (!first) sb.append(", ");
    sb.append("slidingStep:");
    sb.append(this.slidingStep);
    first = false;
    if (isSetIndexes()) {
      if (!first) sb.append(", ");
      sb.append("indexes:");
      if (this.indexes == null) {
        sb.append("null");
      } else {
        sb.append(this.indexes);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'startTime' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'endTime' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'interval' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'slidingStep' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TGroupByTimeParameterStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TGroupByTimeParameterStandardScheme getScheme() {
      return new TGroupByTimeParameterStandardScheme();
    }
  }

  private static class TGroupByTimeParameterStandardScheme extends org.apache.thrift.scheme.StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TGroupByTimeParameter 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: // START_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.startTime = iprot.readI64();
              struct.setStartTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // END_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.endTime = iprot.readI64();
              struct.setEndTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // INTERVAL
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.interval = iprot.readI64();
              struct.setIntervalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // SLIDING_STEP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.slidingStep = iprot.readI64();
              struct.setSlidingStepIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // INDEXES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list560 = iprot.readListBegin();
                struct.indexes = new java.util.ArrayList(_list560.size);
                int _elem561;
                for (int _i562 = 0; _i562 < _list560.size; ++_i562)
                {
                  _elem561 = iprot.readI32();
                  struct.indexes.add(_elem561);
                }
                iprot.readListEnd();
              }
              struct.setIndexesIsSet(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
      if (!struct.isSetStartTime()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'startTime' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetEndTime()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'endTime' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetInterval()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'interval' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetSlidingStep()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'slidingStep' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TGroupByTimeParameter struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_TIME_FIELD_DESC);
      oprot.writeI64(struct.startTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_TIME_FIELD_DESC);
      oprot.writeI64(struct.endTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(INTERVAL_FIELD_DESC);
      oprot.writeI64(struct.interval);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SLIDING_STEP_FIELD_DESC);
      oprot.writeI64(struct.slidingStep);
      oprot.writeFieldEnd();
      if (struct.indexes != null) {
        if (struct.isSetIndexes()) {
          oprot.writeFieldBegin(INDEXES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.indexes.size()));
            for (int _iter563 : struct.indexes)
            {
              oprot.writeI32(_iter563);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TGroupByTimeParameterTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TGroupByTimeParameterTupleScheme getScheme() {
      return new TGroupByTimeParameterTupleScheme();
    }
  }

  private static class TGroupByTimeParameterTupleScheme extends org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TGroupByTimeParameter struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.startTime);
      oprot.writeI64(struct.endTime);
      oprot.writeI64(struct.interval);
      oprot.writeI64(struct.slidingStep);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetIndexes()) {
        optionals.set(0);
      }
      oprot.writeBitSet(optionals, 1);
      if (struct.isSetIndexes()) {
        {
          oprot.writeI32(struct.indexes.size());
          for (int _iter564 : struct.indexes)
          {
            oprot.writeI32(_iter564);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TGroupByTimeParameter struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.startTime = iprot.readI64();
      struct.setStartTimeIsSet(true);
      struct.endTime = iprot.readI64();
      struct.setEndTimeIsSet(true);
      struct.interval = iprot.readI64();
      struct.setIntervalIsSet(true);
      struct.slidingStep = iprot.readI64();
      struct.setSlidingStepIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(1);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list565 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
          struct.indexes = new java.util.ArrayList(_list565.size);
          int _elem566;
          for (int _i567 = 0; _i567 < _list565.size; ++_i567)
          {
            _elem566 = iprot.readI32();
            struct.indexes.add(_elem566);
          }
        }
        struct.setIndexesIsSet(true);
      }
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy