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

com.gen.SiteInfo 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 SiteInfo 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("SiteInfo");

  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)1);
  private static final org.apache.thrift.protocol.TField SITE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("SiteName", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField OS_FIELD_DESC = new org.apache.thrift.protocol.TField("Os", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("Status", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField REAL_PACKAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("RealPackageName", org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final org.apache.thrift.protocol.TField APP_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("AppInfo", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

  public long SiteId; // optional
  public @org.apache.thrift.annotation.Nullable String SiteName; // optional
  public @org.apache.thrift.annotation.Nullable String Os; // optional
  public long Status; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List RealPackageName; // optional
  public @org.apache.thrift.annotation.Nullable AppInfo AppInfo; // 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 {
    SITE_ID((short)1, "SiteId"),
    SITE_NAME((short)2, "SiteName"),
    OS((short)3, "Os"),
    STATUS((short)4, "Status"),
    REAL_PACKAGE_NAME((short)5, "RealPackageName"),
    APP_INFO((short)6, "AppInfo");

    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: // SITE_ID
          return SITE_ID;
        case 2: // SITE_NAME
          return SITE_NAME;
        case 3: // OS
          return OS;
        case 4: // STATUS
          return STATUS;
        case 5: // REAL_PACKAGE_NAME
          return REAL_PACKAGE_NAME;
        case 6: // APP_INFO
          return APP_INFO;
        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 __SITEID_ISSET_ID = 0;
  private static final int __STATUS_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.SITE_ID,_Fields.SITE_NAME,_Fields.OS,_Fields.STATUS,_Fields.REAL_PACKAGE_NAME,_Fields.APP_INFO};
  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.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.SITE_NAME, new org.apache.thrift.meta_data.FieldMetaData("SiteName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OS, new org.apache.thrift.meta_data.FieldMetaData("Os", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("Status", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.REAL_PACKAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("RealPackageName", 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.STRING))));
    tmpMap.put(_Fields.APP_INFO, new org.apache.thrift.meta_data.FieldMetaData("AppInfo", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AppInfo.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SiteInfo.class, metaDataMap);
  }

  public SiteInfo() {
  }

  /**
   * Performs a deep copy on other.
   */
  public SiteInfo(SiteInfo other) {
    __isset_bitfield = other.__isset_bitfield;
    this.SiteId = other.SiteId;
    if (other.isSetSiteName()) {
      this.SiteName = other.SiteName;
    }
    if (other.isSetOs()) {
      this.Os = other.Os;
    }
    this.Status = other.Status;
    if (other.isSetRealPackageName()) {
      java.util.List __this__RealPackageName = new java.util.ArrayList(other.RealPackageName);
      this.RealPackageName = __this__RealPackageName;
    }
    if (other.isSetAppInfo()) {
      this.AppInfo = new AppInfo(other.AppInfo);
    }
  }

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

  @Override
  public void clear() {
    setSiteIdIsSet(false);
    this.SiteId = 0;
    this.SiteName = null;
    this.Os = null;
    setStatusIsSet(false);
    this.Status = 0;
    this.RealPackageName = null;
    this.AppInfo = null;
  }

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

  public SiteInfo 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);
  }

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

  public SiteInfo setSiteName(@org.apache.thrift.annotation.Nullable String SiteName) {
    this.SiteName = SiteName;
    return this;
  }

  public void unsetSiteName() {
    this.SiteName = null;
  }

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

  public void setSiteNameIsSet(boolean value) {
    if (!value) {
      this.SiteName = null;
    }
  }

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

  public SiteInfo setOs(@org.apache.thrift.annotation.Nullable String Os) {
    this.Os = Os;
    return this;
  }

  public void unsetOs() {
    this.Os = null;
  }

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

  public void setOsIsSet(boolean value) {
    if (!value) {
      this.Os = null;
    }
  }

  public long getStatus() {
    return this.Status;
  }

  public SiteInfo setStatus(long Status) {
    this.Status = Status;
    setStatusIsSet(true);
    return this;
  }

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

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

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

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

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

  public void addToRealPackageName(String elem) {
    if (this.RealPackageName == null) {
      this.RealPackageName = new java.util.ArrayList();
    }
    this.RealPackageName.add(elem);
  }

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

  public SiteInfo setRealPackageName(@org.apache.thrift.annotation.Nullable java.util.List RealPackageName) {
    this.RealPackageName = RealPackageName;
    return this;
  }

  public void unsetRealPackageName() {
    this.RealPackageName = null;
  }

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

  public void setRealPackageNameIsSet(boolean value) {
    if (!value) {
      this.RealPackageName = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public AppInfo getAppInfo() {
    return this.AppInfo;
  }

  public SiteInfo setAppInfo(@org.apache.thrift.annotation.Nullable AppInfo AppInfo) {
    this.AppInfo = AppInfo;
    return this;
  }

  public void unsetAppInfo() {
    this.AppInfo = null;
  }

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

  public void setAppInfoIsSet(boolean value) {
    if (!value) {
      this.AppInfo = null;
    }
  }

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

    case SITE_NAME:
      if (value == null) {
        unsetSiteName();
      } else {
        setSiteName((String)value);
      }
      break;

    case OS:
      if (value == null) {
        unsetOs();
      } else {
        setOs((String)value);
      }
      break;

    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((Long)value);
      }
      break;

    case REAL_PACKAGE_NAME:
      if (value == null) {
        unsetRealPackageName();
      } else {
        setRealPackageName((java.util.List)value);
      }
      break;

    case APP_INFO:
      if (value == null) {
        unsetAppInfo();
      } else {
        setAppInfo((AppInfo)value);
      }
      break;

    }
  }

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

    case SITE_NAME:
      return getSiteName();

    case OS:
      return getOs();

    case STATUS:
      return getStatus();

    case REAL_PACKAGE_NAME:
      return getRealPackageName();

    case APP_INFO:
      return getAppInfo();

    }
    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 SITE_ID:
      return isSetSiteId();
    case SITE_NAME:
      return isSetSiteName();
    case OS:
      return isSetOs();
    case STATUS:
      return isSetStatus();
    case REAL_PACKAGE_NAME:
      return isSetRealPackageName();
    case APP_INFO:
      return isSetAppInfo();
    }
    throw new IllegalStateException();
  }

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

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

    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_SiteName = true && this.isSetSiteName();
    boolean that_present_SiteName = true && that.isSetSiteName();
    if (this_present_SiteName || that_present_SiteName) {
      if (!(this_present_SiteName && that_present_SiteName))
        return false;
      if (!this.SiteName.equals(that.SiteName))
        return false;
    }

    boolean this_present_Os = true && this.isSetOs();
    boolean that_present_Os = true && that.isSetOs();
    if (this_present_Os || that_present_Os) {
      if (!(this_present_Os && that_present_Os))
        return false;
      if (!this.Os.equals(that.Os))
        return false;
    }

    boolean this_present_Status = true && this.isSetStatus();
    boolean that_present_Status = true && that.isSetStatus();
    if (this_present_Status || that_present_Status) {
      if (!(this_present_Status && that_present_Status))
        return false;
      if (this.Status != that.Status)
        return false;
    }

    boolean this_present_RealPackageName = true && this.isSetRealPackageName();
    boolean that_present_RealPackageName = true && that.isSetRealPackageName();
    if (this_present_RealPackageName || that_present_RealPackageName) {
      if (!(this_present_RealPackageName && that_present_RealPackageName))
        return false;
      if (!this.RealPackageName.equals(that.RealPackageName))
        return false;
    }

    boolean this_present_AppInfo = true && this.isSetAppInfo();
    boolean that_present_AppInfo = true && that.isSetAppInfo();
    if (this_present_AppInfo || that_present_AppInfo) {
      if (!(this_present_AppInfo && that_present_AppInfo))
        return false;
      if (!this.AppInfo.equals(that.AppInfo))
        return false;
    }

    return true;
  }

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

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

    hashCode = hashCode * 8191 + ((isSetSiteName()) ? 131071 : 524287);
    if (isSetSiteName())
      hashCode = hashCode * 8191 + SiteName.hashCode();

    hashCode = hashCode * 8191 + ((isSetOs()) ? 131071 : 524287);
    if (isSetOs())
      hashCode = hashCode * 8191 + Os.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetRealPackageName()) ? 131071 : 524287);
    if (isSetRealPackageName())
      hashCode = hashCode * 8191 + RealPackageName.hashCode();

    hashCode = hashCode * 8191 + ((isSetAppInfo()) ? 131071 : 524287);
    if (isSetAppInfo())
      hashCode = hashCode * 8191 + AppInfo.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    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(isSetSiteName()).compareTo(other.isSetSiteName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSiteName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.SiteName, other.SiteName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOs()).compareTo(other.isSetOs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Os, other.Os);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Status, other.Status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRealPackageName()).compareTo(other.isSetRealPackageName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRealPackageName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.RealPackageName, other.RealPackageName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAppInfo()).compareTo(other.isSetAppInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAppInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.AppInfo, other.AppInfo);
      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("SiteInfo(");
    boolean first = true;

    if (isSetSiteId()) {
      sb.append("SiteId:");
      sb.append(this.SiteId);
      first = false;
    }
    if (isSetSiteName()) {
      if (!first) sb.append(", ");
      sb.append("SiteName:");
      if (this.SiteName == null) {
        sb.append("null");
      } else {
        sb.append(this.SiteName);
      }
      first = false;
    }
    if (isSetOs()) {
      if (!first) sb.append(", ");
      sb.append("Os:");
      if (this.Os == null) {
        sb.append("null");
      } else {
        sb.append(this.Os);
      }
      first = false;
    }
    if (isSetStatus()) {
      if (!first) sb.append(", ");
      sb.append("Status:");
      sb.append(this.Status);
      first = false;
    }
    if (isSetRealPackageName()) {
      if (!first) sb.append(", ");
      sb.append("RealPackageName:");
      if (this.RealPackageName == null) {
        sb.append("null");
      } else {
        sb.append(this.RealPackageName);
      }
      first = false;
    }
    if (isSetAppInfo()) {
      if (!first) sb.append(", ");
      sb.append("AppInfo:");
      if (this.AppInfo == null) {
        sb.append("null");
      } else {
        sb.append(this.AppInfo);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (AppInfo != null) {
      AppInfo.validate();
    }
  }

  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 SiteInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public SiteInfoStandardScheme getScheme() {
      return new SiteInfoStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, SiteInfo 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: // 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 2: // SITE_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.SiteName = iprot.readString();
              struct.setSiteNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // OS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.Os = iprot.readString();
              struct.setOsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.Status = iprot.readI64();
              struct.setStatusIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // REAL_PACKAGE_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.RealPackageName = new java.util.ArrayList(_list0.size);
                @org.apache.thrift.annotation.Nullable String _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = iprot.readString();
                  struct.RealPackageName.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setRealPackageNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // APP_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.AppInfo = new AppInfo();
              struct.AppInfo.read(iprot);
              struct.setAppInfoIsSet(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, SiteInfo struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetSiteId()) {
        oprot.writeFieldBegin(SITE_ID_FIELD_DESC);
        oprot.writeI64(struct.SiteId);
        oprot.writeFieldEnd();
      }
      if (struct.SiteName != null) {
        if (struct.isSetSiteName()) {
          oprot.writeFieldBegin(SITE_NAME_FIELD_DESC);
          oprot.writeString(struct.SiteName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.Os != null) {
        if (struct.isSetOs()) {
          oprot.writeFieldBegin(OS_FIELD_DESC);
          oprot.writeString(struct.Os);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetStatus()) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI64(struct.Status);
        oprot.writeFieldEnd();
      }
      if (struct.RealPackageName != null) {
        if (struct.isSetRealPackageName()) {
          oprot.writeFieldBegin(REAL_PACKAGE_NAME_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.RealPackageName.size()));
            for (String _iter3 : struct.RealPackageName)
            {
              oprot.writeString(_iter3);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.AppInfo != null) {
        if (struct.isSetAppInfo()) {
          oprot.writeFieldBegin(APP_INFO_FIELD_DESC);
          struct.AppInfo.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, SiteInfo 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.isSetSiteId()) {
        optionals.set(0);
      }
      if (struct.isSetSiteName()) {
        optionals.set(1);
      }
      if (struct.isSetOs()) {
        optionals.set(2);
      }
      if (struct.isSetStatus()) {
        optionals.set(3);
      }
      if (struct.isSetRealPackageName()) {
        optionals.set(4);
      }
      if (struct.isSetAppInfo()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetSiteId()) {
        oprot.writeI64(struct.SiteId);
      }
      if (struct.isSetSiteName()) {
        oprot.writeString(struct.SiteName);
      }
      if (struct.isSetOs()) {
        oprot.writeString(struct.Os);
      }
      if (struct.isSetStatus()) {
        oprot.writeI64(struct.Status);
      }
      if (struct.isSetRealPackageName()) {
        {
          oprot.writeI32(struct.RealPackageName.size());
          for (String _iter4 : struct.RealPackageName)
          {
            oprot.writeString(_iter4);
          }
        }
      }
      if (struct.isSetAppInfo()) {
        struct.AppInfo.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, SiteInfo 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.SiteId = iprot.readI64();
        struct.setSiteIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.SiteName = iprot.readString();
        struct.setSiteNameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.Os = iprot.readString();
        struct.setOsIsSet(true);
      }
      if (incoming.get(3)) {
        struct.Status = iprot.readI64();
        struct.setStatusIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.RealPackageName = new java.util.ArrayList(_list5.size);
          @org.apache.thrift.annotation.Nullable String _elem6;
          for (int _i7 = 0; _i7 < _list5.size; ++_i7)
          {
            _elem6 = iprot.readString();
            struct.RealPackageName.add(_elem6);
          }
        }
        struct.setRealPackageNameIsSet(true);
      }
      if (incoming.get(5)) {
        struct.AppInfo = new AppInfo();
        struct.AppInfo.read(iprot);
        struct.setAppInfoIsSet(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