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

cicada.userdriver.config.marketParam Maven / Gradle / Ivy

There is a newer version: 1.0.6.6
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package cicada.userdriver.config;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-08-15")
public class marketParam 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("marketParam");

  private static final org.apache.thrift.protocol.TField USER_BASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userBaseId", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField MARKET_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("marketType", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField CAN_SHARE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("canShareType", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField PAGE_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pageIndex", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField PAGE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("pageSize", org.apache.thrift.protocol.TType.I32, (short)5);

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

  public String userBaseId; // required
  /**
   * 
   * @see MarketType
   */
  public MarketType marketType; // required
  /**
   * 
   * @see CanShareType
   */
  public CanShareType canShareType; // required
  public int pageIndex; // required
  public int pageSize; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    USER_BASE_ID((short)1, "userBaseId"),
    /**
     * 
     * @see MarketType
     */
    MARKET_TYPE((short)2, "marketType"),
    /**
     * 
     * @see CanShareType
     */
    CAN_SHARE_TYPE((short)3, "canShareType"),
    PAGE_INDEX((short)4, "pageIndex"),
    PAGE_SIZE((short)5, "pageSize");

    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.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // USER_BASE_ID
          return USER_BASE_ID;
        case 2: // MARKET_TYPE
          return MARKET_TYPE;
        case 3: // CAN_SHARE_TYPE
          return CAN_SHARE_TYPE;
        case 4: // PAGE_INDEX
          return PAGE_INDEX;
        case 5: // PAGE_SIZE
          return PAGE_SIZE;
        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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __PAGEINDEX_ISSET_ID = 0;
  private static final int __PAGESIZE_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  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.USER_BASE_ID, new org.apache.thrift.meta_data.FieldMetaData("userBaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.MARKET_TYPE, new org.apache.thrift.meta_data.FieldMetaData("marketType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, MarketType.class)));
    tmpMap.put(_Fields.CAN_SHARE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("canShareType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CanShareType.class)));
    tmpMap.put(_Fields.PAGE_INDEX, new org.apache.thrift.meta_data.FieldMetaData("pageIndex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.PAGE_SIZE, new org.apache.thrift.meta_data.FieldMetaData("pageSize", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        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(marketParam.class, metaDataMap);
  }

  public marketParam() {
    this.pageIndex = 1;

    this.pageSize = 50;

  }

  public marketParam(
    String userBaseId,
    MarketType marketType,
    CanShareType canShareType,
    int pageIndex,
    int pageSize)
  {
    this();
    this.userBaseId = userBaseId;
    this.marketType = marketType;
    this.canShareType = canShareType;
    this.pageIndex = pageIndex;
    setPageIndexIsSet(true);
    this.pageSize = pageSize;
    setPageSizeIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public marketParam(marketParam other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetUserBaseId()) {
      this.userBaseId = other.userBaseId;
    }
    if (other.isSetMarketType()) {
      this.marketType = other.marketType;
    }
    if (other.isSetCanShareType()) {
      this.canShareType = other.canShareType;
    }
    this.pageIndex = other.pageIndex;
    this.pageSize = other.pageSize;
  }

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

  @Override
  public void clear() {
    this.userBaseId = null;
    this.marketType = null;
    this.canShareType = null;
    this.pageIndex = 1;

    this.pageSize = 50;

  }

  public String getUserBaseId() {
    return this.userBaseId;
  }

  public marketParam setUserBaseId(String userBaseId) {
    this.userBaseId = userBaseId;
    return this;
  }

  public void unsetUserBaseId() {
    this.userBaseId = null;
  }

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

  public void setUserBaseIdIsSet(boolean value) {
    if (!value) {
      this.userBaseId = null;
    }
  }

  /**
   * 
   * @see MarketType
   */
  public MarketType getMarketType() {
    return this.marketType;
  }

  /**
   * 
   * @see MarketType
   */
  public marketParam setMarketType(MarketType marketType) {
    this.marketType = marketType;
    return this;
  }

  public void unsetMarketType() {
    this.marketType = null;
  }

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

  public void setMarketTypeIsSet(boolean value) {
    if (!value) {
      this.marketType = null;
    }
  }

  /**
   * 
   * @see CanShareType
   */
  public CanShareType getCanShareType() {
    return this.canShareType;
  }

  /**
   * 
   * @see CanShareType
   */
  public marketParam setCanShareType(CanShareType canShareType) {
    this.canShareType = canShareType;
    return this;
  }

  public void unsetCanShareType() {
    this.canShareType = null;
  }

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

  public void setCanShareTypeIsSet(boolean value) {
    if (!value) {
      this.canShareType = null;
    }
  }

  public int getPageIndex() {
    return this.pageIndex;
  }

  public marketParam setPageIndex(int pageIndex) {
    this.pageIndex = pageIndex;
    setPageIndexIsSet(true);
    return this;
  }

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

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

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

  public int getPageSize() {
    return this.pageSize;
  }

  public marketParam setPageSize(int pageSize) {
    this.pageSize = pageSize;
    setPageSizeIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case USER_BASE_ID:
      if (value == null) {
        unsetUserBaseId();
      } else {
        setUserBaseId((String)value);
      }
      break;

    case MARKET_TYPE:
      if (value == null) {
        unsetMarketType();
      } else {
        setMarketType((MarketType)value);
      }
      break;

    case CAN_SHARE_TYPE:
      if (value == null) {
        unsetCanShareType();
      } else {
        setCanShareType((CanShareType)value);
      }
      break;

    case PAGE_INDEX:
      if (value == null) {
        unsetPageIndex();
      } else {
        setPageIndex((Integer)value);
      }
      break;

    case PAGE_SIZE:
      if (value == null) {
        unsetPageSize();
      } else {
        setPageSize((Integer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case USER_BASE_ID:
      return getUserBaseId();

    case MARKET_TYPE:
      return getMarketType();

    case CAN_SHARE_TYPE:
      return getCanShareType();

    case PAGE_INDEX:
      return getPageIndex();

    case PAGE_SIZE:
      return getPageSize();

    }
    throw new 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 IllegalArgumentException();
    }

    switch (field) {
    case USER_BASE_ID:
      return isSetUserBaseId();
    case MARKET_TYPE:
      return isSetMarketType();
    case CAN_SHARE_TYPE:
      return isSetCanShareType();
    case PAGE_INDEX:
      return isSetPageIndex();
    case PAGE_SIZE:
      return isSetPageSize();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof marketParam)
      return this.equals((marketParam)that);
    return false;
  }

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

    boolean this_present_userBaseId = true && this.isSetUserBaseId();
    boolean that_present_userBaseId = true && that.isSetUserBaseId();
    if (this_present_userBaseId || that_present_userBaseId) {
      if (!(this_present_userBaseId && that_present_userBaseId))
        return false;
      if (!this.userBaseId.equals(that.userBaseId))
        return false;
    }

    boolean this_present_marketType = true && this.isSetMarketType();
    boolean that_present_marketType = true && that.isSetMarketType();
    if (this_present_marketType || that_present_marketType) {
      if (!(this_present_marketType && that_present_marketType))
        return false;
      if (!this.marketType.equals(that.marketType))
        return false;
    }

    boolean this_present_canShareType = true && this.isSetCanShareType();
    boolean that_present_canShareType = true && that.isSetCanShareType();
    if (this_present_canShareType || that_present_canShareType) {
      if (!(this_present_canShareType && that_present_canShareType))
        return false;
      if (!this.canShareType.equals(that.canShareType))
        return false;
    }

    boolean this_present_pageIndex = true;
    boolean that_present_pageIndex = true;
    if (this_present_pageIndex || that_present_pageIndex) {
      if (!(this_present_pageIndex && that_present_pageIndex))
        return false;
      if (this.pageIndex != that.pageIndex)
        return false;
    }

    boolean this_present_pageSize = true;
    boolean that_present_pageSize = true;
    if (this_present_pageSize || that_present_pageSize) {
      if (!(this_present_pageSize && that_present_pageSize))
        return false;
      if (this.pageSize != that.pageSize)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetUserBaseId()) ? 131071 : 524287);
    if (isSetUserBaseId())
      hashCode = hashCode * 8191 + userBaseId.hashCode();

    hashCode = hashCode * 8191 + ((isSetMarketType()) ? 131071 : 524287);
    if (isSetMarketType())
      hashCode = hashCode * 8191 + marketType.getValue();

    hashCode = hashCode * 8191 + ((isSetCanShareType()) ? 131071 : 524287);
    if (isSetCanShareType())
      hashCode = hashCode * 8191 + canShareType.getValue();

    hashCode = hashCode * 8191 + pageIndex;

    hashCode = hashCode * 8191 + pageSize;

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetUserBaseId()).compareTo(other.isSetUserBaseId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserBaseId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userBaseId, other.userBaseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMarketType()).compareTo(other.isSetMarketType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMarketType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.marketType, other.marketType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCanShareType()).compareTo(other.isSetCanShareType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCanShareType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.canShareType, other.canShareType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPageIndex()).compareTo(other.isSetPageIndex());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPageIndex()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pageIndex, other.pageIndex);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPageSize()).compareTo(other.isSetPageSize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPageSize()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pageSize, other.pageSize);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  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 String toString() {
    StringBuilder sb = new StringBuilder("marketParam(");
    boolean first = true;

    sb.append("userBaseId:");
    if (this.userBaseId == null) {
      sb.append("null");
    } else {
      sb.append(this.userBaseId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("marketType:");
    if (this.marketType == null) {
      sb.append("null");
    } else {
      sb.append(this.marketType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("canShareType:");
    if (this.canShareType == null) {
      sb.append("null");
    } else {
      sb.append(this.canShareType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("pageIndex:");
    sb.append(this.pageIndex);
    first = false;
    if (!first) sb.append(", ");
    sb.append("pageSize:");
    sb.append(this.pageSize);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // 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, 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 marketParamStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public marketParamStandardScheme getScheme() {
      return new marketParamStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, marketParam 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: // USER_BASE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.userBaseId = iprot.readString();
              struct.setUserBaseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // MARKET_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.marketType = MarketType.findByValue(iprot.readI32());
              struct.setMarketTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // CAN_SHARE_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.canShareType = cicada.userdriver.config.CanShareType.findByValue(iprot.readI32());
              struct.setCanShareTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PAGE_INDEX
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.pageIndex = iprot.readI32();
              struct.setPageIndexIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // PAGE_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.pageSize = iprot.readI32();
              struct.setPageSizeIsSet(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();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.userBaseId != null) {
        oprot.writeFieldBegin(USER_BASE_ID_FIELD_DESC);
        oprot.writeString(struct.userBaseId);
        oprot.writeFieldEnd();
      }
      if (struct.marketType != null) {
        oprot.writeFieldBegin(MARKET_TYPE_FIELD_DESC);
        oprot.writeI32(struct.marketType.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.canShareType != null) {
        oprot.writeFieldBegin(CAN_SHARE_TYPE_FIELD_DESC);
        oprot.writeI32(struct.canShareType.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(PAGE_INDEX_FIELD_DESC);
      oprot.writeI32(struct.pageIndex);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PAGE_SIZE_FIELD_DESC);
      oprot.writeI32(struct.pageSize);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, marketParam struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetUserBaseId()) {
        optionals.set(0);
      }
      if (struct.isSetMarketType()) {
        optionals.set(1);
      }
      if (struct.isSetCanShareType()) {
        optionals.set(2);
      }
      if (struct.isSetPageIndex()) {
        optionals.set(3);
      }
      if (struct.isSetPageSize()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetUserBaseId()) {
        oprot.writeString(struct.userBaseId);
      }
      if (struct.isSetMarketType()) {
        oprot.writeI32(struct.marketType.getValue());
      }
      if (struct.isSetCanShareType()) {
        oprot.writeI32(struct.canShareType.getValue());
      }
      if (struct.isSetPageIndex()) {
        oprot.writeI32(struct.pageIndex);
      }
      if (struct.isSetPageSize()) {
        oprot.writeI32(struct.pageSize);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, marketParam struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.userBaseId = iprot.readString();
        struct.setUserBaseIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.marketType = MarketType.findByValue(iprot.readI32());
        struct.setMarketTypeIsSet(true);
      }
      if (incoming.get(2)) {
        struct.canShareType = cicada.userdriver.config.CanShareType.findByValue(iprot.readI32());
        struct.setCanShareTypeIsSet(true);
      }
      if (incoming.get(3)) {
        struct.pageIndex = iprot.readI32();
        struct.setPageIndexIsSet(true);
      }
      if (incoming.get(4)) {
        struct.pageSize = iprot.readI32();
        struct.setPageSizeIsSet(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