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

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

  private static final org.apache.thrift.protocol.TField LOG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("LogID", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField CALLER_FIELD_DESC = new org.apache.thrift.protocol.TField("Caller", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField ADDR_FIELD_DESC = new org.apache.thrift.protocol.TField("Addr", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField CLIENT_FIELD_DESC = new org.apache.thrift.protocol.TField("Client", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField TRAFFIC_ENV_FIELD_DESC = new org.apache.thrift.protocol.TField("TrafficEnv", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField EXTRA_FIELD_DESC = new org.apache.thrift.protocol.TField("Extra", org.apache.thrift.protocol.TType.MAP, (short)6);

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

  public @org.apache.thrift.annotation.Nullable String LogID; // required
  public @org.apache.thrift.annotation.Nullable String Caller; // required
  public @org.apache.thrift.annotation.Nullable String Addr; // required
  public @org.apache.thrift.annotation.Nullable String Client; // required
  public @org.apache.thrift.annotation.Nullable
  TrafficEnv TrafficEnv; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map Extra; // 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 {
    LOG_ID((short)1, "LogID"),
    CALLER((short)2, "Caller"),
    ADDR((short)3, "Addr"),
    CLIENT((short)4, "Client"),
    TRAFFIC_ENV((short)5, "TrafficEnv"),
    EXTRA((short)6, "Extra");

    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: // LOG_ID
          return LOG_ID;
        case 2: // CALLER
          return CALLER;
        case 3: // ADDR
          return ADDR;
        case 4: // CLIENT
          return CLIENT;
        case 5: // TRAFFIC_ENV
          return TRAFFIC_ENV;
        case 6: // EXTRA
          return EXTRA;
        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 _Fields optionals[] = {_Fields.TRAFFIC_ENV,_Fields.EXTRA};
  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.LOG_ID, new org.apache.thrift.meta_data.FieldMetaData("LogID", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CALLER, new org.apache.thrift.meta_data.FieldMetaData("Caller", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ADDR, new org.apache.thrift.meta_data.FieldMetaData("Addr", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CLIENT, new org.apache.thrift.meta_data.FieldMetaData("Client", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TRAFFIC_ENV, new org.apache.thrift.meta_data.FieldMetaData("TrafficEnv", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TrafficEnv.class)));
    tmpMap.put(_Fields.EXTRA, new org.apache.thrift.meta_data.FieldMetaData("Extra", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Base.class, metaDataMap);
  }

  public Base() {
    this.LogID = "";

    this.Caller = "";

    this.Addr = "";

    this.Client = "";

  }

  public Base(
    String LogID,
    String Caller,
    String Addr,
    String Client)
  {
    this();
    this.LogID = LogID;
    this.Caller = Caller;
    this.Addr = Addr;
    this.Client = Client;
  }

  /**
   * Performs a deep copy on other.
   */
  public Base(Base other) {
    if (other.isSetLogID()) {
      this.LogID = other.LogID;
    }
    if (other.isSetCaller()) {
      this.Caller = other.Caller;
    }
    if (other.isSetAddr()) {
      this.Addr = other.Addr;
    }
    if (other.isSetClient()) {
      this.Client = other.Client;
    }
    if (other.isSetTrafficEnv()) {
      this.TrafficEnv = new TrafficEnv(other.TrafficEnv);
    }
    if (other.isSetExtra()) {
      java.util.Map __this__Extra = new java.util.HashMap(other.Extra);
      this.Extra = __this__Extra;
    }
  }

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

  @Override
  public void clear() {
    this.LogID = "";

    this.Caller = "";

    this.Addr = "";

    this.Client = "";

    this.TrafficEnv = null;
    this.Extra = null;
  }

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

  public Base setLogID(@org.apache.thrift.annotation.Nullable String LogID) {
    this.LogID = LogID;
    return this;
  }

  public void unsetLogID() {
    this.LogID = null;
  }

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

  public void setLogIDIsSet(boolean value) {
    if (!value) {
      this.LogID = null;
    }
  }

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

  public Base setCaller(@org.apache.thrift.annotation.Nullable String Caller) {
    this.Caller = Caller;
    return this;
  }

  public void unsetCaller() {
    this.Caller = null;
  }

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

  public void setCallerIsSet(boolean value) {
    if (!value) {
      this.Caller = null;
    }
  }

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

  public Base setAddr(@org.apache.thrift.annotation.Nullable String Addr) {
    this.Addr = Addr;
    return this;
  }

  public void unsetAddr() {
    this.Addr = null;
  }

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

  public void setAddrIsSet(boolean value) {
    if (!value) {
      this.Addr = null;
    }
  }

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

  public Base setClient(@org.apache.thrift.annotation.Nullable String Client) {
    this.Client = Client;
    return this;
  }

  public void unsetClient() {
    this.Client = null;
  }

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

  public void setClientIsSet(boolean value) {
    if (!value) {
      this.Client = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TrafficEnv getTrafficEnv() {
    return this.TrafficEnv;
  }

  public Base setTrafficEnv(@org.apache.thrift.annotation.Nullable TrafficEnv TrafficEnv) {
    this.TrafficEnv = TrafficEnv;
    return this;
  }

  public void unsetTrafficEnv() {
    this.TrafficEnv = null;
  }

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

  public void setTrafficEnvIsSet(boolean value) {
    if (!value) {
      this.TrafficEnv = null;
    }
  }

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

  public void putToExtra(String key, String val) {
    if (this.Extra == null) {
      this.Extra = new java.util.HashMap();
    }
    this.Extra.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map getExtra() {
    return this.Extra;
  }

  public Base setExtra(@org.apache.thrift.annotation.Nullable java.util.Map Extra) {
    this.Extra = Extra;
    return this;
  }

  public void unsetExtra() {
    this.Extra = null;
  }

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

  public void setExtraIsSet(boolean value) {
    if (!value) {
      this.Extra = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
    switch (field) {
    case LOG_ID:
      if (value == null) {
        unsetLogID();
      } else {
        setLogID((String)value);
      }
      break;

    case CALLER:
      if (value == null) {
        unsetCaller();
      } else {
        setCaller((String)value);
      }
      break;

    case ADDR:
      if (value == null) {
        unsetAddr();
      } else {
        setAddr((String)value);
      }
      break;

    case CLIENT:
      if (value == null) {
        unsetClient();
      } else {
        setClient((String)value);
      }
      break;

    case TRAFFIC_ENV:
      if (value == null) {
        unsetTrafficEnv();
      } else {
        setTrafficEnv((TrafficEnv)value);
      }
      break;

    case EXTRA:
      if (value == null) {
        unsetExtra();
      } else {
        setExtra((java.util.Map)value);
      }
      break;

    }
  }

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

    case CALLER:
      return getCaller();

    case ADDR:
      return getAddr();

    case CLIENT:
      return getClient();

    case TRAFFIC_ENV:
      return getTrafficEnv();

    case EXTRA:
      return getExtra();

    }
    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 LOG_ID:
      return isSetLogID();
    case CALLER:
      return isSetCaller();
    case ADDR:
      return isSetAddr();
    case CLIENT:
      return isSetClient();
    case TRAFFIC_ENV:
      return isSetTrafficEnv();
    case EXTRA:
      return isSetExtra();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_LogID = true && this.isSetLogID();
    boolean that_present_LogID = true && that.isSetLogID();
    if (this_present_LogID || that_present_LogID) {
      if (!(this_present_LogID && that_present_LogID))
        return false;
      if (!this.LogID.equals(that.LogID))
        return false;
    }

    boolean this_present_Caller = true && this.isSetCaller();
    boolean that_present_Caller = true && that.isSetCaller();
    if (this_present_Caller || that_present_Caller) {
      if (!(this_present_Caller && that_present_Caller))
        return false;
      if (!this.Caller.equals(that.Caller))
        return false;
    }

    boolean this_present_Addr = true && this.isSetAddr();
    boolean that_present_Addr = true && that.isSetAddr();
    if (this_present_Addr || that_present_Addr) {
      if (!(this_present_Addr && that_present_Addr))
        return false;
      if (!this.Addr.equals(that.Addr))
        return false;
    }

    boolean this_present_Client = true && this.isSetClient();
    boolean that_present_Client = true && that.isSetClient();
    if (this_present_Client || that_present_Client) {
      if (!(this_present_Client && that_present_Client))
        return false;
      if (!this.Client.equals(that.Client))
        return false;
    }

    boolean this_present_TrafficEnv = true && this.isSetTrafficEnv();
    boolean that_present_TrafficEnv = true && that.isSetTrafficEnv();
    if (this_present_TrafficEnv || that_present_TrafficEnv) {
      if (!(this_present_TrafficEnv && that_present_TrafficEnv))
        return false;
      if (!this.TrafficEnv.equals(that.TrafficEnv))
        return false;
    }

    boolean this_present_Extra = true && this.isSetExtra();
    boolean that_present_Extra = true && that.isSetExtra();
    if (this_present_Extra || that_present_Extra) {
      if (!(this_present_Extra && that_present_Extra))
        return false;
      if (!this.Extra.equals(that.Extra))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetLogID()) ? 131071 : 524287);
    if (isSetLogID())
      hashCode = hashCode * 8191 + LogID.hashCode();

    hashCode = hashCode * 8191 + ((isSetCaller()) ? 131071 : 524287);
    if (isSetCaller())
      hashCode = hashCode * 8191 + Caller.hashCode();

    hashCode = hashCode * 8191 + ((isSetAddr()) ? 131071 : 524287);
    if (isSetAddr())
      hashCode = hashCode * 8191 + Addr.hashCode();

    hashCode = hashCode * 8191 + ((isSetClient()) ? 131071 : 524287);
    if (isSetClient())
      hashCode = hashCode * 8191 + Client.hashCode();

    hashCode = hashCode * 8191 + ((isSetTrafficEnv()) ? 131071 : 524287);
    if (isSetTrafficEnv())
      hashCode = hashCode * 8191 + TrafficEnv.hashCode();

    hashCode = hashCode * 8191 + ((isSetExtra()) ? 131071 : 524287);
    if (isSetExtra())
      hashCode = hashCode * 8191 + Extra.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetLogID()).compareTo(other.isSetLogID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLogID()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.LogID, other.LogID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCaller()).compareTo(other.isSetCaller());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCaller()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Caller, other.Caller);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddr()).compareTo(other.isSetAddr());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddr()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Addr, other.Addr);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetClient()).compareTo(other.isSetClient());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClient()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Client, other.Client);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTrafficEnv()).compareTo(other.isSetTrafficEnv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTrafficEnv()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.TrafficEnv, other.TrafficEnv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExtra()).compareTo(other.isSetExtra());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExtra()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Extra, other.Extra);
      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("Base(");
    boolean first = true;

    sb.append("LogID:");
    if (this.LogID == null) {
      sb.append("null");
    } else {
      sb.append(this.LogID);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("Caller:");
    if (this.Caller == null) {
      sb.append("null");
    } else {
      sb.append(this.Caller);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("Addr:");
    if (this.Addr == null) {
      sb.append("null");
    } else {
      sb.append(this.Addr);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("Client:");
    if (this.Client == null) {
      sb.append("null");
    } else {
      sb.append(this.Client);
    }
    first = false;
    if (isSetTrafficEnv()) {
      if (!first) sb.append(", ");
      sb.append("TrafficEnv:");
      if (this.TrafficEnv == null) {
        sb.append("null");
      } else {
        sb.append(this.TrafficEnv);
      }
      first = false;
    }
    if (isSetExtra()) {
      if (!first) sb.append(", ");
      sb.append("Extra:");
      if (this.Extra == null) {
        sb.append("null");
      } else {
        sb.append(this.Extra);
      }
      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 (TrafficEnv != null) {
      TrafficEnv.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 {
      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 BaseStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public BaseStandardScheme getScheme() {
      return new BaseStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, Base 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: // LOG_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.LogID = iprot.readString();
              struct.setLogIDIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CALLER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.Caller = iprot.readString();
              struct.setCallerIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // ADDR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.Addr = iprot.readString();
              struct.setAddrIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CLIENT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.Client = iprot.readString();
              struct.setClientIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // TRAFFIC_ENV
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.TrafficEnv = new TrafficEnv();
              struct.TrafficEnv.read(iprot);
              struct.setTrafficEnvIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // EXTRA
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
                struct.Extra = new java.util.HashMap(2*_map0.size);
                @org.apache.thrift.annotation.Nullable String _key1;
                @org.apache.thrift.annotation.Nullable String _val2;
                for (int _i3 = 0; _i3 < _map0.size; ++_i3)
                {
                  _key1 = iprot.readString();
                  _val2 = iprot.readString();
                  struct.Extra.put(_key1, _val2);
                }
                iprot.readMapEnd();
              }
              struct.setExtraIsSet(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, Base struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.LogID != null) {
        oprot.writeFieldBegin(LOG_ID_FIELD_DESC);
        oprot.writeString(struct.LogID);
        oprot.writeFieldEnd();
      }
      if (struct.Caller != null) {
        oprot.writeFieldBegin(CALLER_FIELD_DESC);
        oprot.writeString(struct.Caller);
        oprot.writeFieldEnd();
      }
      if (struct.Addr != null) {
        oprot.writeFieldBegin(ADDR_FIELD_DESC);
        oprot.writeString(struct.Addr);
        oprot.writeFieldEnd();
      }
      if (struct.Client != null) {
        oprot.writeFieldBegin(CLIENT_FIELD_DESC);
        oprot.writeString(struct.Client);
        oprot.writeFieldEnd();
      }
      if (struct.TrafficEnv != null) {
        if (struct.isSetTrafficEnv()) {
          oprot.writeFieldBegin(TRAFFIC_ENV_FIELD_DESC);
          struct.TrafficEnv.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.Extra != null) {
        if (struct.isSetExtra()) {
          oprot.writeFieldBegin(EXTRA_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.Extra.size()));
            for (java.util.Map.Entry _iter4 : struct.Extra.entrySet())
            {
              oprot.writeString(_iter4.getKey());
              oprot.writeString(_iter4.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Base 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.isSetLogID()) {
        optionals.set(0);
      }
      if (struct.isSetCaller()) {
        optionals.set(1);
      }
      if (struct.isSetAddr()) {
        optionals.set(2);
      }
      if (struct.isSetClient()) {
        optionals.set(3);
      }
      if (struct.isSetTrafficEnv()) {
        optionals.set(4);
      }
      if (struct.isSetExtra()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetLogID()) {
        oprot.writeString(struct.LogID);
      }
      if (struct.isSetCaller()) {
        oprot.writeString(struct.Caller);
      }
      if (struct.isSetAddr()) {
        oprot.writeString(struct.Addr);
      }
      if (struct.isSetClient()) {
        oprot.writeString(struct.Client);
      }
      if (struct.isSetTrafficEnv()) {
        struct.TrafficEnv.write(oprot);
      }
      if (struct.isSetExtra()) {
        {
          oprot.writeI32(struct.Extra.size());
          for (java.util.Map.Entry _iter5 : struct.Extra.entrySet())
          {
            oprot.writeString(_iter5.getKey());
            oprot.writeString(_iter5.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Base 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.LogID = iprot.readString();
        struct.setLogIDIsSet(true);
      }
      if (incoming.get(1)) {
        struct.Caller = iprot.readString();
        struct.setCallerIsSet(true);
      }
      if (incoming.get(2)) {
        struct.Addr = iprot.readString();
        struct.setAddrIsSet(true);
      }
      if (incoming.get(3)) {
        struct.Client = iprot.readString();
        struct.setClientIsSet(true);
      }
      if (incoming.get(4)) {
        struct.TrafficEnv = new TrafficEnv();
        struct.TrafficEnv.read(iprot);
        struct.setTrafficEnvIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.Extra = new java.util.HashMap(2*_map6.size);
          @org.apache.thrift.annotation.Nullable String _key7;
          @org.apache.thrift.annotation.Nullable String _val8;
          for (int _i9 = 0; _i9 < _map6.size; ++_i9)
          {
            _key7 = iprot.readString();
            _val8 = iprot.readString();
            struct.Extra.put(_key7, _val8);
          }
        }
        struct.setExtraIsSet(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