/**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.blur.thrift.generated;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.blur.thirdparty.thrift_0_9_0.scheme.IScheme;
import org.apache.blur.thirdparty.thrift_0_9_0.scheme.SchemeFactory;
import org.apache.blur.thirdparty.thrift_0_9_0.scheme.StandardScheme;
import org.apache.blur.thirdparty.thrift_0_9_0.scheme.TupleScheme;
import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TTupleProtocol;
import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolException;
import org.apache.blur.thirdparty.thrift_0_9_0.EncodingUtils;
import org.apache.blur.thirdparty.thrift_0_9_0.TException;
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.nio.ByteBuffer;
import java.util.Arrays;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
public class CommandDescriptor implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<CommandDescriptor, CommandDescriptor._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("CommandDescriptor");
private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField COMMAND_NAME_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("commandName", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)1);
private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("description", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)2);
private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField REQUIRED_ARGUMENTS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("requiredArguments", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)3);
private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField OPTIONAL_ARGUMENTS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("optionalArguments", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)4);
private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField RETURN_TYPE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("returnType", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)5);
private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField VERSION_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("version", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)6);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new CommandDescriptorStandardSchemeFactory());
schemes.put(TupleScheme.class, new CommandDescriptorTupleSchemeFactory());
}
public String commandName; // required
public String description; // required
public Map<String,ArgumentDescriptor> requiredArguments; // required
public Map<String,ArgumentDescriptor> optionalArguments; // required
public String returnType; // required
public String version; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum {
COMMAND_NAME((short)1, "commandName"),
DESCRIPTION((short)2, "description"),
REQUIRED_ARGUMENTS((short)3, "requiredArguments"),
OPTIONAL_ARGUMENTS((short)4, "optionalArguments"),
RETURN_TYPE((short)5, "returnType"),
VERSION((short)6, "version");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // COMMAND_NAME
return COMMAND_NAME;
case 2: // DESCRIPTION
return DESCRIPTION;
case 3: // REQUIRED_ARGUMENTS
return REQUIRED_ARGUMENTS;
case 4: // OPTIONAL_ARGUMENTS
return OPTIONAL_ARGUMENTS;
case 5: // RETURN_TYPE
return RETURN_TYPE;
case 6: // VERSION
return VERSION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.COMMAND_NAME, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("commandName", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)));
tmpMap.put(_Fields.DESCRIPTION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("description", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)));
tmpMap.put(_Fields.REQUIRED_ARGUMENTS, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("requiredArguments", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.MapMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING),
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, ArgumentDescriptor.class))));
tmpMap.put(_Fields.OPTIONAL_ARGUMENTS, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("optionalArguments", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.MapMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING),
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, ArgumentDescriptor.class))));
tmpMap.put(_Fields.RETURN_TYPE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("returnType", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)));
tmpMap.put(_Fields.VERSION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("version", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT,
new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(CommandDescriptor.class, metaDataMap);
}
public CommandDescriptor() {
}
public CommandDescriptor(
String commandName,
String description,
Map<String,ArgumentDescriptor> requiredArguments,
Map<String,ArgumentDescriptor> optionalArguments,
String returnType,
String version)
{
this();
this.commandName = commandName;
this.description = description;
this.requiredArguments = requiredArguments;
this.optionalArguments = optionalArguments;
this.returnType = returnType;
this.version = version;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public CommandDescriptor(CommandDescriptor other) {
if (other.isSetCommandName()) {
this.commandName = other.commandName;
}
if (other.isSetDescription()) {
this.description = other.description;
}
if (other.isSetRequiredArguments()) {
Map<String,ArgumentDescriptor> __this__requiredArguments = new HashMap<String,ArgumentDescriptor>();
for (Map.Entry<String, ArgumentDescriptor> other_element : other.requiredArguments.entrySet()) {
String other_element_key = other_element.getKey();
ArgumentDescriptor other_element_value = other_element.getValue();
String __this__requiredArguments_copy_key = other_element_key;
ArgumentDescriptor __this__requiredArguments_copy_value = new ArgumentDescriptor(other_element_value);
__this__requiredArguments.put(__this__requiredArguments_copy_key, __this__requiredArguments_copy_value);
}
this.requiredArguments = __this__requiredArguments;
}
if (other.isSetOptionalArguments()) {
Map<String,ArgumentDescriptor> __this__optionalArguments = new HashMap<String,ArgumentDescriptor>();
for (Map.Entry<String, ArgumentDescriptor> other_element : other.optionalArguments.entrySet()) {
String other_element_key = other_element.getKey();
ArgumentDescriptor other_element_value = other_element.getValue();
String __this__optionalArguments_copy_key = other_element_key;
ArgumentDescriptor __this__optionalArguments_copy_value = new ArgumentDescriptor(other_element_value);
__this__optionalArguments.put(__this__optionalArguments_copy_key, __this__optionalArguments_copy_value);
}
this.optionalArguments = __this__optionalArguments;
}
if (other.isSetReturnType()) {
this.returnType = other.returnType;
}
if (other.isSetVersion()) {
this.version = other.version;
}
}
public CommandDescriptor deepCopy() {
return new CommandDescriptor(this);
}
@Override
public void clear() {
this.commandName = null;
this.description = null;
this.requiredArguments = null;
this.optionalArguments = null;
this.returnType = null;
this.version = null;
}
public String getCommandName() {
return this.commandName;
}
public CommandDescriptor setCommandName(String commandName) {
this.commandName = commandName;
return this;
}
public void unsetCommandName() {
this.commandName = null;
}
/** Returns true if field commandName is set (has been assigned a value) and false otherwise */
public boolean isSetCommandName() {
return this.commandName != null;
}
public void setCommandNameIsSet(boolean value) {
if (!value) {
this.commandName = null;
}
}
public String getDescription() {
return this.description;
}
public CommandDescriptor setDescription(String description) {
this.description = description;
return this;
}
public void unsetDescription() {
this.description = null;
}
/** Returns true if field description is set (has been assigned a value) and false otherwise */
public boolean isSetDescription() {
return this.description != null;
}
public void setDescriptionIsSet(boolean value) {
if (!value) {
this.description = null;
}
}
public int getRequiredArgumentsSize() {
return (this.requiredArguments == null) ? 0 : this.requiredArguments.size();
}
public void putToRequiredArguments(String key, ArgumentDescriptor val) {
if (this.requiredArguments == null) {
this.requiredArguments = new HashMap<String,ArgumentDescriptor>();
}
this.requiredArguments.put(key, val);
}
public Map<String,ArgumentDescriptor> getRequiredArguments() {
return this.requiredArguments;
}
public CommandDescriptor setRequiredArguments(Map<String,ArgumentDescriptor> requiredArguments) {
this.requiredArguments = requiredArguments;
return this;
}
public void unsetRequiredArguments() {
this.requiredArguments = null;
}
/** Returns true if field requiredArguments is set (has been assigned a value) and false otherwise */
public boolean isSetRequiredArguments() {
return this.requiredArguments != null;
}
public void setRequiredArgumentsIsSet(boolean value) {
if (!value) {
this.requiredArguments = null;
}
}
public int getOptionalArgumentsSize() {
return (this.optionalArguments == null) ? 0 : this.optionalArguments.size();
}
public void putToOptionalArguments(String key, ArgumentDescriptor val) {
if (this.optionalArguments == null) {
this.optionalArguments = new HashMap<String,ArgumentDescriptor>();
}
this.optionalArguments.put(key, val);
}
public Map<String,ArgumentDescriptor> getOptionalArguments() {
return this.optionalArguments;
}
public CommandDescriptor setOptionalArguments(Map<String,ArgumentDescriptor> optionalArguments) {
this.optionalArguments = optionalArguments;
return this;
}
public void unsetOptionalArguments() {
this.optionalArguments = null;
}
/** Returns true if field optionalArguments is set (has been assigned a value) and false otherwise */
public boolean isSetOptionalArguments() {
return this.optionalArguments != null;
}
public void setOptionalArgumentsIsSet(boolean value) {
if (!value) {
this.optionalArguments = null;
}
}
public String getReturnType() {
return this.returnType;
}
public CommandDescriptor setReturnType(String returnType) {
this.returnType = returnType;
return this;
}
public void unsetReturnType() {
this.returnType = null;
}
/** Returns true if field returnType is set (has been assigned a value) and false otherwise */
public boolean isSetReturnType() {
return this.returnType != null;
}
public void setReturnTypeIsSet(boolean value) {
if (!value) {
this.returnType = null;
}
}
public String getVersion() {
return this.version;
}
public CommandDescriptor setVersion(String version) {
this.version = version;
return this;
}
public void unsetVersion() {
this.version = null;
}
/** Returns true if field version is set (has been assigned a value) and false otherwise */
public boolean isSetVersion() {
return this.version != null;
}
public void setVersionIsSet(boolean value) {
if (!value) {
this.version = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case COMMAND_NAME:
if (value == null) {
unsetCommandName();
} else {
setCommandName((String)value);
}
break;
case DESCRIPTION:
if (value == null) {
unsetDescription();
} else {
setDescription((String)value);
}
break;
case REQUIRED_ARGUMENTS:
if (value == null) {
unsetRequiredArguments();
} else {
setRequiredArguments((Map<String,ArgumentDescriptor>)value);
}
break;
case OPTIONAL_ARGUMENTS:
if (value == null) {
unsetOptionalArguments();
} else {
setOptionalArguments((Map<String,ArgumentDescriptor>)value);
}
break;
case RETURN_TYPE:
if (value == null) {
unsetReturnType();
} else {
setReturnType((String)value);
}
break;
case VERSION:
if (value == null) {
unsetVersion();
} else {
setVersion((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case COMMAND_NAME:
return getCommandName();
case DESCRIPTION:
return getDescription();
case REQUIRED_ARGUMENTS:
return getRequiredArguments();
case OPTIONAL_ARGUMENTS:
return getOptionalArguments();
case RETURN_TYPE:
return getReturnType();
case VERSION:
return getVersion();
}
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 COMMAND_NAME:
return isSetCommandName();
case DESCRIPTION:
return isSetDescription();
case REQUIRED_ARGUMENTS:
return isSetRequiredArguments();
case OPTIONAL_ARGUMENTS:
return isSetOptionalArguments();
case RETURN_TYPE:
return isSetReturnType();
case VERSION:
return isSetVersion();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof CommandDescriptor)
return this.equals((CommandDescriptor)that);
return false;
}
public boolean equals(CommandDescriptor that) {
if (that == null)
return false;
boolean this_present_commandName = true && this.isSetCommandName();
boolean that_present_commandName = true && that.isSetCommandName();
if (this_present_commandName || that_present_commandName) {
if (!(this_present_commandName && that_present_commandName))
return false;
if (!this.commandName.equals(that.commandName))
return false;
}
boolean this_present_description = true && this.isSetDescription();
boolean that_present_description = true && that.isSetDescription();
if (this_present_description || that_present_description) {
if (!(this_present_description && that_present_description))
return false;
if (!this.description.equals(that.description))
return false;
}
boolean this_present_requiredArguments = true && this.isSetRequiredArguments();
boolean that_present_requiredArguments = true && that.isSetRequiredArguments();
if (this_present_requiredArguments || that_present_requiredArguments) {
if (!(this_present_requiredArguments && that_present_requiredArguments))
return false;
if (!this.requiredArguments.equals(that.requiredArguments))
return false;
}
boolean this_present_optionalArguments = true && this.isSetOptionalArguments();
boolean that_present_optionalArguments = true && that.isSetOptionalArguments();
if (this_present_optionalArguments || that_present_optionalArguments) {
if (!(this_present_optionalArguments && that_present_optionalArguments))
return false;
if (!this.optionalArguments.equals(that.optionalArguments))
return false;
}
boolean this_present_returnType = true && this.isSetReturnType();
boolean that_present_returnType = true && that.isSetReturnType();
if (this_present_returnType || that_present_returnType) {
if (!(this_present_returnType && that_present_returnType))
return false;
if (!this.returnType.equals(that.returnType))
return false;
}
boolean this_present_version = true && this.isSetVersion();
boolean that_present_version = true && that.isSetVersion();
if (this_present_version || that_present_version) {
if (!(this_present_version && that_present_version))
return false;
if (!this.version.equals(that.version))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(CommandDescriptor other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
CommandDescriptor typedOther = (CommandDescriptor)other;
lastComparison = Boolean.valueOf(isSetCommandName()).compareTo(typedOther.isSetCommandName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCommandName()) {
lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.commandName, typedOther.commandName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDescription()) {
lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.description, typedOther.description);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetRequiredArguments()).compareTo(typedOther.isSetRequiredArguments());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRequiredArguments()) {
lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.requiredArguments, typedOther.requiredArguments);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptionalArguments()).compareTo(typedOther.isSetOptionalArguments());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptionalArguments()) {
lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.optionalArguments, typedOther.optionalArguments);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetReturnType()).compareTo(typedOther.isSetReturnType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReturnType()) {
lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.returnType, typedOther.returnType);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetVersion()).compareTo(typedOther.isSetVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetVersion()) {
lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.version, typedOther.version);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("CommandDescriptor(");
boolean first = true;
sb.append("commandName:");
if (this.commandName == null) {
sb.append("null");
} else {
sb.append(this.commandName);
}
first = false;
if (!first) sb.append(", ");
sb.append("description:");
if (this.description == null) {
sb.append("null");
} else {
sb.append(this.description);
}
first = false;
if (!first) sb.append(", ");
sb.append("requiredArguments:");
if (this.requiredArguments == null) {
sb.append("null");
} else {
sb.append(this.requiredArguments);
}
first = false;
if (!first) sb.append(", ");
sb.append("optionalArguments:");
if (this.optionalArguments == null) {
sb.append("null");
} else {
sb.append(this.optionalArguments);
}
first = false;
if (!first) sb.append(", ");
sb.append("returnType:");
if (this.returnType == null) {
sb.append("null");
} else {
sb.append(this.returnType);
}
first = false;
if (!first) sb.append(", ");
sb.append("version:");
if (this.version == null) {
sb.append("null");
} else {
sb.append(this.version);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out)));
} catch (org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in)));
} catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) {
throw new java.io.IOException(te);
}
}
private static class CommandDescriptorStandardSchemeFactory implements SchemeFactory {
public CommandDescriptorStandardScheme getScheme() {
return new CommandDescriptorStandardScheme();
}
}
private static class CommandDescriptorStandardScheme extends StandardScheme<CommandDescriptor> {
public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, CommandDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // COMMAND_NAME
if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) {
struct.commandName = iprot.readString();
struct.setCommandNameIsSet(true);
} else {
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // DESCRIPTION
if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) {
struct.description = iprot.readString();
struct.setDescriptionIsSet(true);
} else {
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // REQUIRED_ARGUMENTS
if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP) {
{
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map290 = iprot.readMapBegin();
struct.requiredArguments = new HashMap<String,ArgumentDescriptor>(2*_map290.size);
for (int _i291 = 0; _i291 < _map290.size; ++_i291)
{
String _key292; // required
ArgumentDescriptor _val293; // required
_key292 = iprot.readString();
_val293 = new ArgumentDescriptor();
_val293.read(iprot);
struct.requiredArguments.put(_key292, _val293);
}
iprot.readMapEnd();
}
struct.setRequiredArgumentsIsSet(true);
} else {
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // OPTIONAL_ARGUMENTS
if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP) {
{
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map294 = iprot.readMapBegin();
struct.optionalArguments = new HashMap<String,ArgumentDescriptor>(2*_map294.size);
for (int _i295 = 0; _i295 < _map294.size; ++_i295)
{
String _key296; // required
ArgumentDescriptor _val297; // required
_key296 = iprot.readString();
_val297 = new ArgumentDescriptor();
_val297.read(iprot);
struct.optionalArguments.put(_key296, _val297);
}
iprot.readMapEnd();
}
struct.setOptionalArgumentsIsSet(true);
} else {
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // RETURN_TYPE
if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) {
struct.returnType = iprot.readString();
struct.setReturnTypeIsSet(true);
} else {
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // VERSION
if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
} else {
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, CommandDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.commandName != null) {
oprot.writeFieldBegin(COMMAND_NAME_FIELD_DESC);
oprot.writeString(struct.commandName);
oprot.writeFieldEnd();
}
if (struct.description != null) {
oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
oprot.writeString(struct.description);
oprot.writeFieldEnd();
}
if (struct.requiredArguments != null) {
oprot.writeFieldBegin(REQUIRED_ARGUMENTS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.requiredArguments.size()));
for (Map.Entry<String, ArgumentDescriptor> _iter298 : struct.requiredArguments.entrySet())
{
oprot.writeString(_iter298.getKey());
_iter298.getValue().write(oprot);
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
if (struct.optionalArguments != null) {
oprot.writeFieldBegin(OPTIONAL_ARGUMENTS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.optionalArguments.size()));
for (Map.Entry<String, ArgumentDescriptor> _iter299 : struct.optionalArguments.entrySet())
{
oprot.writeString(_iter299.getKey());
_iter299.getValue().write(oprot);
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
if (struct.returnType != null) {
oprot.writeFieldBegin(RETURN_TYPE_FIELD_DESC);
oprot.writeString(struct.returnType);
oprot.writeFieldEnd();
}
if (struct.version != null) {
oprot.writeFieldBegin(VERSION_FIELD_DESC);
oprot.writeString(struct.version);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class CommandDescriptorTupleSchemeFactory implements SchemeFactory {
public CommandDescriptorTupleScheme getScheme() {
return new CommandDescriptorTupleScheme();
}
}
private static class CommandDescriptorTupleScheme extends TupleScheme<CommandDescriptor> {
@Override
public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, CommandDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetCommandName()) {
optionals.set(0);
}
if (struct.isSetDescription()) {
optionals.set(1);
}
if (struct.isSetRequiredArguments()) {
optionals.set(2);
}
if (struct.isSetOptionalArguments()) {
optionals.set(3);
}
if (struct.isSetReturnType()) {
optionals.set(4);
}
if (struct.isSetVersion()) {
optionals.set(5);
}
oprot.writeBitSet(optionals, 6);
if (struct.isSetCommandName()) {
oprot.writeString(struct.commandName);
}
if (struct.isSetDescription()) {
oprot.writeString(struct.description);
}
if (struct.isSetRequiredArguments()) {
{
oprot.writeI32(struct.requiredArguments.size());
for (Map.Entry<String, ArgumentDescriptor> _iter300 : struct.requiredArguments.entrySet())
{
oprot.writeString(_iter300.getKey());
_iter300.getValue().write(oprot);
}
}
}
if (struct.isSetOptionalArguments()) {
{
oprot.writeI32(struct.optionalArguments.size());
for (Map.Entry<String, ArgumentDescriptor> _iter301 : struct.optionalArguments.entrySet())
{
oprot.writeString(_iter301.getKey());
_iter301.getValue().write(oprot);
}
}
}
if (struct.isSetReturnType()) {
oprot.writeString(struct.returnType);
}
if (struct.isSetVersion()) {
oprot.writeString(struct.version);
}
}
@Override
public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, CommandDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(6);
if (incoming.get(0)) {
struct.commandName = iprot.readString();
struct.setCommandNameIsSet(true);
}
if (incoming.get(1)) {
struct.description = iprot.readString();
struct.setDescriptionIsSet(true);
}
if (incoming.get(2)) {
{
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map302 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32());
struct.requiredArguments = new HashMap<String,ArgumentDescriptor>(2*_map302.size);
for (int _i303 = 0; _i303 < _map302.size; ++_i303)
{
String _key304; // required
ArgumentDescriptor _val305; // required
_key304 = iprot.readString();
_val305 = new ArgumentDescriptor();
_val305.read(iprot);
struct.requiredArguments.put(_key304, _val305);
}
}
struct.setRequiredArgumentsIsSet(true);
}
if (incoming.get(3)) {
{
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map306 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32());
struct.optionalArguments = new HashMap<String,ArgumentDescriptor>(2*_map306.size);
for (int _i307 = 0; _i307 < _map306.size; ++_i307)
{
String _key308; // required
ArgumentDescriptor _val309; // required
_key308 = iprot.readString();
_val309 = new ArgumentDescriptor();
_val309.read(iprot);
struct.optionalArguments.put(_key308, _val309);
}
}
struct.setOptionalArgumentsIsSet(true);
}
if (incoming.get(4)) {
struct.returnType = iprot.readString();
struct.setReturnTypeIsSet(true);
}
if (incoming.get(5)) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
}
}
}
}