Subversion Repositories SmartDukaan

Rev

Rev 48 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.config;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;

public class Configuration {

  public interface Iface {

    public String getPropetry(String propertyName) throws ConfigException, TException;

    public void loadProperty(String propertyName, String propertyValue) throws TException;

  }

  public static class Client implements Iface {
    public Client(TProtocol prot)
    {
      this(prot, prot);
    }

    public Client(TProtocol iprot, TProtocol oprot)
    {
      iprot_ = iprot;
      oprot_ = oprot;
    }

    protected TProtocol iprot_;
    protected TProtocol oprot_;

    protected int seqid_;

    public TProtocol getInputProtocol()
    {
      return this.iprot_;
    }

    public TProtocol getOutputProtocol()
    {
      return this.oprot_;
    }

    public String getPropetry(String propertyName) throws ConfigException, TException
    {
      send_getPropetry(propertyName);
      return recv_getPropetry();
    }

    public void send_getPropetry(String propertyName) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getPropetry", TMessageType.CALL, seqid_));
      getPropetry_args args = new getPropetry_args();
      args.propertyName = propertyName;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public String recv_getPropetry() throws ConfigException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getPropetry_result result = new getPropetry_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.e != null) {
        throw result.e;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPropetry failed: unknown result");
    }

    public void loadProperty(String propertyName, String propertyValue) throws TException
    {
      send_loadProperty(propertyName, propertyValue);
      recv_loadProperty();
    }

    public void send_loadProperty(String propertyName, String propertyValue) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("loadProperty", TMessageType.CALL, seqid_));
      loadProperty_args args = new loadProperty_args();
      args.propertyName = propertyName;
      args.propertyValue = propertyValue;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_loadProperty() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      loadProperty_result result = new loadProperty_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      return;
    }

  }
  public static class Processor implements TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(Iface iface)
    {
      iface_ = iface;
      processMap_.put("getPropetry", new getPropetry());
      processMap_.put("loadProperty", new loadProperty());
    }

    protected static interface ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
    }

    private Iface iface_;
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();

    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
    {
      TMessage msg = iprot.readMessageBegin();
      ProcessFunction fn = processMap_.get(msg.name);
      if (fn == null) {
        TProtocolUtil.skip(iprot, TType.STRUCT);
        iprot.readMessageEnd();
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
        x.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
        return true;
      }
      fn.process(msg.seqid, iprot, oprot);
      return true;
    }

    private class getPropetry implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getPropetry_args args = new getPropetry_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getPropetry_result result = new getPropetry_result();
        try {
          result.success = iface_.getPropetry(args.propertyName);
        } catch (ConfigException e) {
          result.e = e;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getPropetry", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPropetry");
          oprot.writeMessageBegin(new TMessage("getPropetry", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getPropetry", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class loadProperty implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        loadProperty_args args = new loadProperty_args();
        args.read(iprot);
        iprot.readMessageEnd();
        loadProperty_result result = new loadProperty_result();
        iface_.loadProperty(args.propertyName, args.propertyValue);
        oprot.writeMessageBegin(new TMessage("loadProperty", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

  }

  public static class getPropetry_args implements TBase<getPropetry_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPropetry_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getPropetry_args");

    private static final TField PROPERTY_NAME_FIELD_DESC = new TField("propertyName", TType.STRING, (short)1);

    private String propertyName;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      PROPERTY_NAME((short)1, "propertyName");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * 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

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.PROPERTY_NAME, new FieldMetaData("propertyName", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getPropetry_args.class, metaDataMap);
    }

    public getPropetry_args() {
    }

    public getPropetry_args(
      String propertyName)
    {
      this();
      this.propertyName = propertyName;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPropetry_args(getPropetry_args other) {
      if (other.isSetPropertyName()) {
        this.propertyName = other.propertyName;
      }
    }

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

    @Deprecated
    public getPropetry_args clone() {
      return new getPropetry_args(this);
    }

    public String getPropertyName() {
      return this.propertyName;
    }

    public getPropetry_args setPropertyName(String propertyName) {
      this.propertyName = propertyName;
      return this;
    }

    public void unsetPropertyName() {
      this.propertyName = null;
    }

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

    public void setPropertyNameIsSet(boolean value) {
      if (!value) {
        this.propertyName = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PROPERTY_NAME:
        if (value == null) {
          unsetPropertyName();
        } else {
          setPropertyName((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PROPERTY_NAME:
        return getPropertyName();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case PROPERTY_NAME:
        return isSetPropertyName();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getPropetry_args that) {
      if (that == null)
        return false;

      boolean this_present_propertyName = true && this.isSetPropertyName();
      boolean that_present_propertyName = true && that.isSetPropertyName();
      if (this_present_propertyName || that_present_propertyName) {
        if (!(this_present_propertyName && that_present_propertyName))
          return false;
        if (!this.propertyName.equals(that.propertyName))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

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

      int lastComparison = 0;
      getPropetry_args typedOther = (getPropetry_args)other;

      lastComparison = Boolean.valueOf(isSetPropertyName()).compareTo(isSetPropertyName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(propertyName, typedOther.propertyName);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case PROPERTY_NAME:
              if (field.type == TType.STRING) {
                this.propertyName = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.propertyName != null) {
        oprot.writeFieldBegin(PROPERTY_NAME_FIELD_DESC);
        oprot.writeString(this.propertyName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPropetry_args(");
      boolean first = true;

      sb.append("propertyName:");
      if (this.propertyName == null) {
        sb.append("null");
      } else {
        sb.append(this.propertyName);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getPropetry_result implements TBase<getPropetry_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPropetry_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getPropetry_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0);
    private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1);

    private String success;
    private ConfigException e;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      E((short)1, "e");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * 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

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getPropetry_result.class, metaDataMap);
    }

    public getPropetry_result() {
    }

    public getPropetry_result(
      String success,
      ConfigException e)
    {
      this();
      this.success = success;
      this.e = e;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPropetry_result(getPropetry_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetE()) {
        this.e = new ConfigException(other.e);
      }
    }

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

    @Deprecated
    public getPropetry_result clone() {
      return new getPropetry_result(this);
    }

    public String getSuccess() {
      return this.success;
    }

    public getPropetry_result setSuccess(String success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public ConfigException getE() {
      return this.e;
    }

    public getPropetry_result setE(ConfigException e) {
      this.e = e;
      return this;
    }

    public void unsetE() {
      this.e = null;
    }

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

    public void setEIsSet(boolean value) {
      if (!value) {
        this.e = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((String)value);
        }
        break;

      case E:
        if (value == null) {
          unsetE();
        } else {
          setE((ConfigException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case E:
        return getE();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case E:
        return isSetE();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getPropetry_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_e = true && this.isSetE();
      boolean that_present_e = true && that.isSetE();
      if (this_present_e || that_present_e) {
        if (!(this_present_e && that_present_e))
          return false;
        if (!this.e.equals(that.e))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

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

      int lastComparison = 0;
      getPropetry_result typedOther = (getPropetry_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetE()).compareTo(isSetE());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(e, typedOther.e);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRING) {
                this.success = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case E:
              if (field.type == TType.STRUCT) {
                this.e = new ConfigException();
                this.e.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeString(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetE()) {
        oprot.writeFieldBegin(E_FIELD_DESC);
        this.e.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPropetry_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("e:");
      if (this.e == null) {
        sb.append("null");
      } else {
        sb.append(this.e);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class loadProperty_args implements TBase<loadProperty_args._Fields>, java.io.Serializable, Cloneable, Comparable<loadProperty_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("loadProperty_args");

    private static final TField PROPERTY_NAME_FIELD_DESC = new TField("propertyName", TType.STRING, (short)1);
    private static final TField PROPERTY_VALUE_FIELD_DESC = new TField("propertyValue", TType.STRING, (short)2);

    private String propertyName;
    private String propertyValue;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      PROPERTY_NAME((short)1, "propertyName"),
      PROPERTY_VALUE((short)2, "propertyValue");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * 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

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.PROPERTY_NAME, new FieldMetaData("propertyName", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.PROPERTY_VALUE, new FieldMetaData("propertyValue", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(loadProperty_args.class, metaDataMap);
    }

    public loadProperty_args() {
    }

    public loadProperty_args(
      String propertyName,
      String propertyValue)
    {
      this();
      this.propertyName = propertyName;
      this.propertyValue = propertyValue;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public loadProperty_args(loadProperty_args other) {
      if (other.isSetPropertyName()) {
        this.propertyName = other.propertyName;
      }
      if (other.isSetPropertyValue()) {
        this.propertyValue = other.propertyValue;
      }
    }

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

    @Deprecated
    public loadProperty_args clone() {
      return new loadProperty_args(this);
    }

    public String getPropertyName() {
      return this.propertyName;
    }

    public loadProperty_args setPropertyName(String propertyName) {
      this.propertyName = propertyName;
      return this;
    }

    public void unsetPropertyName() {
      this.propertyName = null;
    }

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

    public void setPropertyNameIsSet(boolean value) {
      if (!value) {
        this.propertyName = null;
      }
    }

    public String getPropertyValue() {
      return this.propertyValue;
    }

    public loadProperty_args setPropertyValue(String propertyValue) {
      this.propertyValue = propertyValue;
      return this;
    }

    public void unsetPropertyValue() {
      this.propertyValue = null;
    }

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

    public void setPropertyValueIsSet(boolean value) {
      if (!value) {
        this.propertyValue = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PROPERTY_NAME:
        if (value == null) {
          unsetPropertyName();
        } else {
          setPropertyName((String)value);
        }
        break;

      case PROPERTY_VALUE:
        if (value == null) {
          unsetPropertyValue();
        } else {
          setPropertyValue((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PROPERTY_NAME:
        return getPropertyName();

      case PROPERTY_VALUE:
        return getPropertyValue();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case PROPERTY_NAME:
        return isSetPropertyName();
      case PROPERTY_VALUE:
        return isSetPropertyValue();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(loadProperty_args that) {
      if (that == null)
        return false;

      boolean this_present_propertyName = true && this.isSetPropertyName();
      boolean that_present_propertyName = true && that.isSetPropertyName();
      if (this_present_propertyName || that_present_propertyName) {
        if (!(this_present_propertyName && that_present_propertyName))
          return false;
        if (!this.propertyName.equals(that.propertyName))
          return false;
      }

      boolean this_present_propertyValue = true && this.isSetPropertyValue();
      boolean that_present_propertyValue = true && that.isSetPropertyValue();
      if (this_present_propertyValue || that_present_propertyValue) {
        if (!(this_present_propertyValue && that_present_propertyValue))
          return false;
        if (!this.propertyValue.equals(that.propertyValue))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

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

      int lastComparison = 0;
      loadProperty_args typedOther = (loadProperty_args)other;

      lastComparison = Boolean.valueOf(isSetPropertyName()).compareTo(isSetPropertyName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(propertyName, typedOther.propertyName);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetPropertyValue()).compareTo(isSetPropertyValue());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(propertyValue, typedOther.propertyValue);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case PROPERTY_NAME:
              if (field.type == TType.STRING) {
                this.propertyName = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PROPERTY_VALUE:
              if (field.type == TType.STRING) {
                this.propertyValue = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.propertyName != null) {
        oprot.writeFieldBegin(PROPERTY_NAME_FIELD_DESC);
        oprot.writeString(this.propertyName);
        oprot.writeFieldEnd();
      }
      if (this.propertyValue != null) {
        oprot.writeFieldBegin(PROPERTY_VALUE_FIELD_DESC);
        oprot.writeString(this.propertyValue);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("loadProperty_args(");
      boolean first = true;

      sb.append("propertyName:");
      if (this.propertyName == null) {
        sb.append("null");
      } else {
        sb.append(this.propertyName);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("propertyValue:");
      if (this.propertyValue == null) {
        sb.append("null");
      } else {
        sb.append(this.propertyValue);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class loadProperty_result implements TBase<loadProperty_result._Fields>, java.io.Serializable, Cloneable, Comparable<loadProperty_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("loadProperty_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * 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;
      }
    }
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(loadProperty_result.class, metaDataMap);
    }

    public loadProperty_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public loadProperty_result(loadProperty_result other) {
    }

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

    @Deprecated
    public loadProperty_result clone() {
      return new loadProperty_result(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(loadProperty_result that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

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

      int lastComparison = 0;
      loadProperty_result typedOther = (loadProperty_result)other;

      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("loadProperty_result(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

}