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

com.gen.AppInfo Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
package com.gen;

/**
 * Autogenerated by Thrift Compiler (0.13.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-02-04")
public class AppInfo 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("AppInfo");

  private static final org.apache.thrift.protocol.TField APP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("AppId", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField APP_CN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("AppCnName", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField APP_EN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("AppEnName", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField PRODUCT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ProductId", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField SITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("SiteId", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("UserId", org.apache.thrift.protocol.TType.I64, (short)6);

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

  public long AppId; // optional
  public @org.apache.thrift.annotation.Nullable String AppCnName; // optional
  public @org.apache.thrift.annotation.Nullable String AppEnName; // optional
  public long ProductId; // optional
  public long SiteId; // optional
  public long UserId; // 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 {
    APP_ID((short)1, "AppId"),
    APP_CN_NAME((short)2, "AppCnName"),
    APP_EN_NAME((short)3, "AppEnName"),
    PRODUCT_ID((short)4, "ProductId"),
    SITE_ID((short)5, "SiteId"),
    USER_ID((short)6, "UserId");

    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: // APP_ID
          return APP_ID;
        case 2: // APP_CN_NAME
          return APP_CN_NAME;
        case 3: // APP_EN_NAME
          return APP_EN_NAME;
        case 4: // PRODUCT_ID
          return PRODUCT_ID;
        case 5: // SITE_ID
          return SITE_ID;
        case 6: // USER_ID
          return USER_ID;
        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.
     */
    @org.apache.thrift.annotation.Nullable
    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 __APPID_ISSET_ID = 0;
  private static final int __PRODUCTID_ISSET_ID = 1;
  private static final int __SITEID_ISSET_ID = 2;
  private static final int __USERID_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.APP_ID,_Fields.APP_CN_NAME,_Fields.APP_EN_NAME,_Fields.PRODUCT_ID,_Fields.SITE_ID,_Fields.USER_ID};
  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.APP_ID, new org.apache.thrift.meta_data.FieldMetaData("AppId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.APP_CN_NAME, new org.apache.thrift.meta_data.FieldMetaData("AppCnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.APP_EN_NAME, new org.apache.thrift.meta_data.FieldMetaData("AppEnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PRODUCT_ID, new org.apache.thrift.meta_data.FieldMetaData("ProductId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SITE_ID, new org.apache.thrift.meta_data.FieldMetaData("SiteId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("UserId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AppInfo.class, metaDataMap);
  }

  public AppInfo() {
  }

  /**
   * Performs a deep copy on other.
   */
  public AppInfo(AppInfo other) {
    __isset_bitfield = other.__isset_bitfield;
    this.AppId = other.AppId;
    if (other.isSetAppCnName()) {
      this.AppCnName = other.AppCnName;
    }
    if (other.isSetAppEnName()) {
      this.AppEnName = other.AppEnName;
    }
    this.ProductId = other.ProductId;
    this.SiteId = other.SiteId;
    this.UserId = other.UserId;
  }

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

  @Override
  public void clear() {
    setAppIdIsSet(false);
    this.AppId = 0;
    this.AppCnName = null;
    this.AppEnName = null;
    setProductIdIsSet(false);
    this.ProductId = 0;
    setSiteIdIsSet(false);
    this.SiteId = 0;
    setUserIdIsSet(false);
    this.UserId = 0;
  }

  public long getAppId() {
    return this.AppId;
  }

  public AppInfo setAppId(long AppId) {
    this.AppId = AppId;
    setAppIdIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public String getAppCnName() {
    return this.AppCnName;
  }

  public AppInfo setAppCnName(@org.apache.thrift.annotation.Nullable String AppCnName) {
    this.AppCnName = AppCnName;
    return this;
  }

  public void unsetAppCnName() {
    this.AppCnName = null;
  }

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

  public void setAppCnNameIsSet(boolean value) {
    if (!value) {
      this.AppCnName = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public String getAppEnName() {
    return this.AppEnName;
  }

  public AppInfo setAppEnName(@org.apache.thrift.annotation.Nullable String AppEnName) {
    this.AppEnName = AppEnName;
    return this;
  }

  public void unsetAppEnName() {
    this.AppEnName = null;
  }

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

  public void setAppEnNameIsSet(boolean value) {
    if (!value) {
      this.AppEnName = null;
    }
  }

  public long getProductId() {
    return this.ProductId;
  }

  public AppInfo setProductId(long ProductId) {
    this.ProductId = ProductId;
    setProductIdIsSet(true);
    return this;
  }

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

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

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

  public long getSiteId() {
    return this.SiteId;
  }

  public AppInfo setSiteId(long SiteId) {
    this.SiteId = SiteId;
    setSiteIdIsSet(true);
    return this;
  }

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

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

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

  public long getUserId() {
    return this.UserId;
  }

  public AppInfo setUserId(long UserId) {
    this.UserId = UserId;
    setUserIdIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
    switch (field) {
    case APP_ID:
      if (value == null) {
        unsetAppId();
      } else {
        setAppId((Long)value);
      }
      break;

    case APP_CN_NAME:
      if (value == null) {
        unsetAppCnName();
      } else {
        setAppCnName((String)value);
      }
      break;

    case APP_EN_NAME:
      if (value == null) {
        unsetAppEnName();
      } else {
        setAppEnName((String)value);
      }
      break;

    case PRODUCT_ID:
      if (value == null) {
        unsetProductId();
      } else {
        setProductId((Long)value);
      }
      break;

    case SITE_ID:
      if (value == null) {
        unsetSiteId();
      } else {
        setSiteId((Long)value);
      }
      break;

    case USER_ID:
      if (value == null) {
        unsetUserId();
      } else {
        setUserId((Long)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public Object getFieldValue(_Fields field) {
    switch (field) {
    case APP_ID:
      return getAppId();

    case APP_CN_NAME:
      return getAppCnName();

    case APP_EN_NAME:
      return getAppEnName();

    case PRODUCT_ID:
      return getProductId();

    case SITE_ID:
      return getSiteId();

    case USER_ID:
      return getUserId();

    }
    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 APP_ID:
      return isSetAppId();
    case APP_CN_NAME:
      return isSetAppCnName();
    case APP_EN_NAME:
      return isSetAppEnName();
    case PRODUCT_ID:
      return isSetProductId();
    case SITE_ID:
      return isSetSiteId();
    case USER_ID:
      return isSetUserId();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_AppId = true && this.isSetAppId();
    boolean that_present_AppId = true && that.isSetAppId();
    if (this_present_AppId || that_present_AppId) {
      if (!(this_present_AppId && that_present_AppId))
        return false;
      if (this.AppId != that.AppId)
        return false;
    }

    boolean this_present_AppCnName = true && this.isSetAppCnName();
    boolean that_present_AppCnName = true && that.isSetAppCnName();
    if (this_present_AppCnName || that_present_AppCnName) {
      if (!(this_present_AppCnName && that_present_AppCnName))
        return false;
      if (!this.AppCnName.equals(that.AppCnName))
        return false;
    }

    boolean this_present_AppEnName = true && this.isSetAppEnName();
    boolean that_present_AppEnName = true && that.isSetAppEnName();
    if (this_present_AppEnName || that_present_AppEnName) {
      if (!(this_present_AppEnName && that_present_AppEnName))
        return false;
      if (!this.AppEnName.equals(that.AppEnName))
        return false;
    }

    boolean this_present_ProductId = true && this.isSetProductId();
    boolean that_present_ProductId = true && that.isSetProductId();
    if (this_present_ProductId || that_present_ProductId) {
      if (!(this_present_ProductId && that_present_ProductId))
        return false;
      if (this.ProductId != that.ProductId)
        return false;
    }

    boolean this_present_SiteId = true && this.isSetSiteId();
    boolean that_present_SiteId = true && that.isSetSiteId();
    if (this_present_SiteId || that_present_SiteId) {
      if (!(this_present_SiteId && that_present_SiteId))
        return false;
      if (this.SiteId != that.SiteId)
        return false;
    }

    boolean this_present_UserId = true && this.isSetUserId();
    boolean that_present_UserId = true && that.isSetUserId();
    if (this_present_UserId || that_present_UserId) {
      if (!(this_present_UserId && that_present_UserId))
        return false;
      if (this.UserId != that.UserId)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetAppId()) ? 131071 : 524287);
    if (isSetAppId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(AppId);

    hashCode = hashCode * 8191 + ((isSetAppCnName()) ? 131071 : 524287);
    if (isSetAppCnName())
      hashCode = hashCode * 8191 + AppCnName.hashCode();

    hashCode = hashCode * 8191 + ((isSetAppEnName()) ? 131071 : 524287);
    if (isSetAppEnName())
      hashCode = hashCode * 8191 + AppEnName.hashCode();

    hashCode = hashCode * 8191 + ((isSetProductId()) ? 131071 : 524287);
    if (isSetProductId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(ProductId);

    hashCode = hashCode * 8191 + ((isSetSiteId()) ? 131071 : 524287);
    if (isSetSiteId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(SiteId);

    hashCode = hashCode * 8191 + ((isSetUserId()) ? 131071 : 524287);
    if (isSetUserId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(UserId);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetAppId()).compareTo(other.isSetAppId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAppId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.AppId, other.AppId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAppCnName()).compareTo(other.isSetAppCnName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAppCnName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.AppCnName, other.AppCnName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAppEnName()).compareTo(other.isSetAppEnName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAppEnName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.AppEnName, other.AppEnName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProductId()).compareTo(other.isSetProductId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProductId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ProductId, other.ProductId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSiteId()).compareTo(other.isSetSiteId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSiteId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.SiteId, other.SiteId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.UserId, other.UserId);
      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 String toString() {
    StringBuilder sb = new StringBuilder("AppInfo(");
    boolean first = true;

    if (isSetAppId()) {
      sb.append("AppId:");
      sb.append(this.AppId);
      first = false;
    }
    if (isSetAppCnName()) {
      if (!first) sb.append(", ");
      sb.append("AppCnName:");
      if (this.AppCnName == null) {
        sb.append("null");
      } else {
        sb.append(this.AppCnName);
      }
      first = false;
    }
    if (isSetAppEnName()) {
      if (!first) sb.append(", ");
      sb.append("AppEnName:");
      if (this.AppEnName == null) {
        sb.append("null");
      } else {
        sb.append(this.AppEnName);
      }
      first = false;
    }
    if (isSetProductId()) {
      if (!first) sb.append(", ");
      sb.append("ProductId:");
      sb.append(this.ProductId);
      first = false;
    }
    if (isSetSiteId()) {
      if (!first) sb.append(", ");
      sb.append("SiteId:");
      sb.append(this.SiteId);
      first = false;
    }
    if (isSetUserId()) {
      if (!first) sb.append(", ");
      sb.append("UserId:");
      sb.append(this.UserId);
      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 AppInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public AppInfoStandardScheme getScheme() {
      return new AppInfoStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, AppInfo 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: // APP_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.AppId = iprot.readI64();
              struct.setAppIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // APP_CN_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.AppCnName = iprot.readString();
              struct.setAppCnNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // APP_EN_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.AppEnName = iprot.readString();
              struct.setAppEnNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PRODUCT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.ProductId = iprot.readI64();
              struct.setProductIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // SITE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.SiteId = iprot.readI64();
              struct.setSiteIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // USER_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.UserId = iprot.readI64();
              struct.setUserIdIsSet(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, AppInfo struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetAppId()) {
        oprot.writeFieldBegin(APP_ID_FIELD_DESC);
        oprot.writeI64(struct.AppId);
        oprot.writeFieldEnd();
      }
      if (struct.AppCnName != null) {
        if (struct.isSetAppCnName()) {
          oprot.writeFieldBegin(APP_CN_NAME_FIELD_DESC);
          oprot.writeString(struct.AppCnName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.AppEnName != null) {
        if (struct.isSetAppEnName()) {
          oprot.writeFieldBegin(APP_EN_NAME_FIELD_DESC);
          oprot.writeString(struct.AppEnName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetProductId()) {
        oprot.writeFieldBegin(PRODUCT_ID_FIELD_DESC);
        oprot.writeI64(struct.ProductId);
        oprot.writeFieldEnd();
      }
      if (struct.isSetSiteId()) {
        oprot.writeFieldBegin(SITE_ID_FIELD_DESC);
        oprot.writeI64(struct.SiteId);
        oprot.writeFieldEnd();
      }
      if (struct.isSetUserId()) {
        oprot.writeFieldBegin(USER_ID_FIELD_DESC);
        oprot.writeI64(struct.UserId);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, AppInfo 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.isSetAppId()) {
        optionals.set(0);
      }
      if (struct.isSetAppCnName()) {
        optionals.set(1);
      }
      if (struct.isSetAppEnName()) {
        optionals.set(2);
      }
      if (struct.isSetProductId()) {
        optionals.set(3);
      }
      if (struct.isSetSiteId()) {
        optionals.set(4);
      }
      if (struct.isSetUserId()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetAppId()) {
        oprot.writeI64(struct.AppId);
      }
      if (struct.isSetAppCnName()) {
        oprot.writeString(struct.AppCnName);
      }
      if (struct.isSetAppEnName()) {
        oprot.writeString(struct.AppEnName);
      }
      if (struct.isSetProductId()) {
        oprot.writeI64(struct.ProductId);
      }
      if (struct.isSetSiteId()) {
        oprot.writeI64(struct.SiteId);
      }
      if (struct.isSetUserId()) {
        oprot.writeI64(struct.UserId);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, AppInfo struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.AppId = iprot.readI64();
        struct.setAppIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.AppCnName = iprot.readString();
        struct.setAppCnNameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.AppEnName = iprot.readString();
        struct.setAppEnNameIsSet(true);
      }
      if (incoming.get(3)) {
        struct.ProductId = iprot.readI64();
        struct.setProductIdIsSet(true);
      }
      if (incoming.get(4)) {
        struct.SiteId = iprot.readI64();
        struct.setSiteIdIsSet(true);
      }
      if (incoming.get(5)) {
        struct.UserId = iprot.readI64();
        struct.setUserIdIsSet(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