http://git-wip-us.apache.org/repos/asf/curator/blob/95b70d2b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java deleted file mode 100644 index d14f14d..0000000 --- a/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.curator.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 LeaseProjection implements org.apache.thrift.TBase<LeaseProjection, LeaseProjection._Fields>, java.io.Serializable, Cloneable, Comparable<LeaseProjection> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LeaseProjection"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new LeaseProjectionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new LeaseProjectionTupleSchemeFactory()); - } - - public String id; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)1, "id"); - - 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: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - 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.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LeaseProjection.class, metaDataMap); - } - - public LeaseProjection() { - } - - public LeaseProjection( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public LeaseProjection(LeaseProjection other) { - if (other.isSetId()) { - this.id = other.id; - } - } - - public LeaseProjection deepCopy() { - return new LeaseProjection(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String getId() { - return this.id; - } - - public LeaseProjection setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - } - 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 ID: - return isSetId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof LeaseProjection) - return this.equals((LeaseProjection)that); - return false; - } - - public boolean equals(LeaseProjection that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(LeaseProjection other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("LeaseProjection("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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 LeaseProjectionStandardSchemeFactory implements SchemeFactory { - public LeaseProjectionStandardScheme getScheme() { - return new LeaseProjectionStandardScheme(); - } - } - - private static class LeaseProjectionStandardScheme extends StandardScheme<LeaseProjection> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, LeaseProjection 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: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(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, LeaseProjection struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class LeaseProjectionTupleSchemeFactory implements SchemeFactory { - public LeaseProjectionTupleScheme getScheme() { - return new LeaseProjectionTupleScheme(); - } - } - - private static class LeaseProjectionTupleScheme extends TupleScheme<LeaseProjection> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, LeaseProjection struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, LeaseProjection struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - } - } - -} -
http://git-wip-us.apache.org/repos/asf/curator/blob/95b70d2b/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java deleted file mode 100644 index 4927e72..0000000 --- a/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.curator.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 LockProjection implements org.apache.thrift.TBase<LockProjection, LockProjection._Fields>, java.io.Serializable, Cloneable, Comparable<LockProjection> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LockProjection"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new LockProjectionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new LockProjectionTupleSchemeFactory()); - } - - public String id; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)1, "id"); - - 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: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - 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.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LockProjection.class, metaDataMap); - } - - public LockProjection() { - } - - public LockProjection( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public LockProjection(LockProjection other) { - if (other.isSetId()) { - this.id = other.id; - } - } - - public LockProjection deepCopy() { - return new LockProjection(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String getId() { - return this.id; - } - - public LockProjection setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - } - 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 ID: - return isSetId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof LockProjection) - return this.equals((LockProjection)that); - return false; - } - - public boolean equals(LockProjection that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(LockProjection other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("LockProjection("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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 LockProjectionStandardSchemeFactory implements SchemeFactory { - public LockProjectionStandardScheme getScheme() { - return new LockProjectionStandardScheme(); - } - } - - private static class LockProjectionStandardScheme extends StandardScheme<LockProjection> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, LockProjection 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: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(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, LockProjection struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class LockProjectionTupleSchemeFactory implements SchemeFactory { - public LockProjectionTupleScheme getScheme() { - return new LockProjectionTupleScheme(); - } - } - - private static class LockProjectionTupleScheme extends TupleScheme<LockProjection> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, LockProjection struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, LockProjection struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/curator/blob/95b70d2b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java deleted file mode 100644 index c5f6df9..0000000 --- a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.curator.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 NodeCacheProjection implements org.apache.thrift.TBase<NodeCacheProjection, NodeCacheProjection._Fields>, java.io.Serializable, Cloneable, Comparable<NodeCacheProjection> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NodeCacheProjection"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new NodeCacheProjectionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new NodeCacheProjectionTupleSchemeFactory()); - } - - public String id; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)1, "id"); - - 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: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - 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.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NodeCacheProjection.class, metaDataMap); - } - - public NodeCacheProjection() { - } - - public NodeCacheProjection( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public NodeCacheProjection(NodeCacheProjection other) { - if (other.isSetId()) { - this.id = other.id; - } - } - - public NodeCacheProjection deepCopy() { - return new NodeCacheProjection(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String getId() { - return this.id; - } - - public NodeCacheProjection setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - } - 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 ID: - return isSetId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof NodeCacheProjection) - return this.equals((NodeCacheProjection)that); - return false; - } - - public boolean equals(NodeCacheProjection that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(NodeCacheProjection other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("NodeCacheProjection("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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 NodeCacheProjectionStandardSchemeFactory implements SchemeFactory { - public NodeCacheProjectionStandardScheme getScheme() { - return new NodeCacheProjectionStandardScheme(); - } - } - - private static class NodeCacheProjectionStandardScheme extends StandardScheme<NodeCacheProjection> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, NodeCacheProjection 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: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(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, NodeCacheProjection struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class NodeCacheProjectionTupleSchemeFactory implements SchemeFactory { - public NodeCacheProjectionTupleScheme getScheme() { - return new NodeCacheProjectionTupleScheme(); - } - } - - private static class NodeCacheProjectionTupleScheme extends TupleScheme<NodeCacheProjection> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, NodeCacheProjection struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, NodeCacheProjection struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/curator/blob/95b70d2b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java deleted file mode 100644 index fb2a989..0000000 --- a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.curator.generated; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum NodeExceptionType implements org.apache.thrift.TEnum { - NONODE(0), - BADVERSION(1), - NODEEXISTS(2), - NOTEMPTY(3); - - private final int value; - - private NodeExceptionType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static NodeExceptionType findByValue(int value) { - switch (value) { - case 0: - return NONODE; - case 1: - return BADVERSION; - case 2: - return NODEEXISTS; - case 3: - return NOTEMPTY; - default: - return null; - } - } -} http://git-wip-us.apache.org/repos/asf/curator/blob/95b70d2b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalChildrenList.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalChildrenList.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalChildrenList.java deleted file mode 100644 index e052215..0000000 --- a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalChildrenList.java +++ /dev/null @@ -1,437 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.curator.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 OptionalChildrenList implements org.apache.thrift.TBase<OptionalChildrenList, OptionalChildrenList._Fields>, java.io.Serializable, Cloneable, Comparable<OptionalChildrenList> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OptionalChildrenList"); - - private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new OptionalChildrenListStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OptionalChildrenListTupleSchemeFactory()); - } - - public List<String> children; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - CHILDREN((short)1, "children"); - - 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: // CHILDREN - return CHILDREN; - 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.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptionalChildrenList.class, metaDataMap); - } - - public OptionalChildrenList() { - } - - public OptionalChildrenList( - List<String> children) - { - this(); - this.children = children; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public OptionalChildrenList(OptionalChildrenList other) { - if (other.isSetChildren()) { - List<String> __this__children = new ArrayList<String>(other.children); - this.children = __this__children; - } - } - - public OptionalChildrenList deepCopy() { - return new OptionalChildrenList(this); - } - - @Override - public void clear() { - this.children = null; - } - - public int getChildrenSize() { - return (this.children == null) ? 0 : this.children.size(); - } - - public java.util.Iterator<String> getChildrenIterator() { - return (this.children == null) ? null : this.children.iterator(); - } - - public void addToChildren(String elem) { - if (this.children == null) { - this.children = new ArrayList<String>(); - } - this.children.add(elem); - } - - public List<String> getChildren() { - return this.children; - } - - public OptionalChildrenList setChildren(List<String> children) { - this.children = children; - return this; - } - - public void unsetChildren() { - this.children = null; - } - - /** Returns true if field children is set (has been assigned a value) and false otherwise */ - public boolean isSetChildren() { - return this.children != null; - } - - public void setChildrenIsSet(boolean value) { - if (!value) { - this.children = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case CHILDREN: - if (value == null) { - unsetChildren(); - } else { - setChildren((List<String>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case CHILDREN: - return getChildren(); - - } - 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 CHILDREN: - return isSetChildren(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof OptionalChildrenList) - return this.equals((OptionalChildrenList)that); - return false; - } - - public boolean equals(OptionalChildrenList that) { - if (that == null) - return false; - - boolean this_present_children = true && this.isSetChildren(); - boolean that_present_children = true && that.isSetChildren(); - if (this_present_children || that_present_children) { - if (!(this_present_children && that_present_children)) - return false; - if (!this.children.equals(that.children)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(OptionalChildrenList other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetChildren()).compareTo(other.isSetChildren()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetChildren()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, other.children); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("OptionalChildrenList("); - boolean first = true; - - sb.append("children:"); - if (this.children == null) { - sb.append("null"); - } else { - sb.append(this.children); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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 OptionalChildrenListStandardSchemeFactory implements SchemeFactory { - public OptionalChildrenListStandardScheme getScheme() { - return new OptionalChildrenListStandardScheme(); - } - } - - private static class OptionalChildrenListStandardScheme extends StandardScheme<OptionalChildrenList> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OptionalChildrenList 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: // CHILDREN - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.children = new ArrayList<String>(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { - String _elem2; - _elem2 = iprot.readString(); - struct.children.add(_elem2); - } - iprot.readListEnd(); - } - struct.setChildrenIsSet(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, OptionalChildrenList struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.children != null) { - oprot.writeFieldBegin(CHILDREN_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.children.size())); - for (String _iter3 : struct.children) - { - oprot.writeString(_iter3); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class OptionalChildrenListTupleSchemeFactory implements SchemeFactory { - public OptionalChildrenListTupleScheme getScheme() { - return new OptionalChildrenListTupleScheme(); - } - } - - private static class OptionalChildrenListTupleScheme extends TupleScheme<OptionalChildrenList> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OptionalChildrenList struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetChildren()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetChildren()) { - { - oprot.writeI32(struct.children.size()); - for (String _iter4 : struct.children) - { - oprot.writeString(_iter4); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, OptionalChildrenList struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.children = new ArrayList<String>(_list5.size); - for (int _i6 = 0; _i6 < _list5.size; ++_i6) - { - String _elem7; - _elem7 = iprot.readString(); - struct.children.add(_elem7); - } - } - struct.setChildrenIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/curator/blob/95b70d2b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java deleted file mode 100644 index c9b720b..0000000 --- a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java +++ /dev/null @@ -1,399 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.curator.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 OptionalData implements org.apache.thrift.TBase<OptionalData, OptionalData._Fields>, java.io.Serializable, Cloneable, Comparable<OptionalData> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OptionalData"); - - private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new OptionalDataStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OptionalDataTupleSchemeFactory()); - } - - public ByteBuffer data; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - DATA((short)1, "data"); - - 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: // DATA - return DATA; - 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.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptionalData.class, metaDataMap); - } - - public OptionalData() { - } - - public OptionalData( - ByteBuffer data) - { - this(); - this.data = data; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public OptionalData(OptionalData other) { - if (other.isSetData()) { - this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data); -; - } - } - - public OptionalData deepCopy() { - return new OptionalData(this); - } - - @Override - public void clear() { - this.data = null; - } - - public byte[] getData() { - setData(org.apache.thrift.TBaseHelper.rightSize(data)); - return data == null ? null : data.array(); - } - - public ByteBuffer bufferForData() { - return data; - } - - public OptionalData setData(byte[] data) { - setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data)); - return this; - } - - public OptionalData setData(ByteBuffer data) { - this.data = data; - return this; - } - - public void unsetData() { - this.data = null; - } - - /** Returns true if field data is set (has been assigned a value) and false otherwise */ - public boolean isSetData() { - return this.data != null; - } - - public void setDataIsSet(boolean value) { - if (!value) { - this.data = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case DATA: - if (value == null) { - unsetData(); - } else { - setData((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case DATA: - return getData(); - - } - 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 DATA: - return isSetData(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof OptionalData) - return this.equals((OptionalData)that); - return false; - } - - public boolean equals(OptionalData that) { - if (that == null) - return false; - - boolean this_present_data = true && this.isSetData(); - boolean that_present_data = true && that.isSetData(); - if (this_present_data || that_present_data) { - if (!(this_present_data && that_present_data)) - return false; - if (!this.data.equals(that.data)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(OptionalData other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetData()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("OptionalData("); - boolean first = true; - - sb.append("data:"); - if (this.data == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.data, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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 OptionalDataStandardSchemeFactory implements SchemeFactory { - public OptionalDataStandardScheme getScheme() { - return new OptionalDataStandardScheme(); - } - } - - private static class OptionalDataStandardScheme extends StandardScheme<OptionalData> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OptionalData 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: // DATA - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.data = iprot.readBinary(); - struct.setDataIsSet(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, OptionalData struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.data != null) { - oprot.writeFieldBegin(DATA_FIELD_DESC); - oprot.writeBinary(struct.data); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class OptionalDataTupleSchemeFactory implements SchemeFactory { - public OptionalDataTupleScheme getScheme() { - return new OptionalDataTupleScheme(); - } - } - - private static class OptionalDataTupleScheme extends TupleScheme<OptionalData> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OptionalData struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetData()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetData()) { - oprot.writeBinary(struct.data); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, OptionalData struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.data = iprot.readBinary(); - struct.setDataIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/curator/blob/95b70d2b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java deleted file mode 100644 index 8e9c629..0000000 --- a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.curator.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 OptionalLockProjection implements org.apache.thrift.TBase<OptionalLockProjection, OptionalLockProjection._Fields>, java.io.Serializable, Cloneable, Comparable<OptionalLockProjection> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OptionalLockProjection"); - - private static final org.apache.thrift.protocol.TField LOCK_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("lockProjection", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new OptionalLockProjectionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OptionalLockProjectionTupleSchemeFactory()); - } - - public LockProjection lockProjection; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - LOCK_PROJECTION((short)1, "lockProjection"); - - 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: // LOCK_PROJECTION - return LOCK_PROJECTION; - 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.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.LOCK_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("lockProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LockProjection.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptionalLockProjection.class, metaDataMap); - } - - public OptionalLockProjection() { - } - - public OptionalLockProjection( - LockProjection lockProjection) - { - this(); - this.lockProjection = lockProjection; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public OptionalLockProjection(OptionalLockProjection other) { - if (other.isSetLockProjection()) { - this.lockProjection = new LockProjection(other.lockProjection); - } - } - - public OptionalLockProjection deepCopy() { - return new OptionalLockProjection(this); - } - - @Override - public void clear() { - this.lockProjection = null; - } - - public LockProjection getLockProjection() { - return this.lockProjection; - } - - public OptionalLockProjection setLockProjection(LockProjection lockProjection) { - this.lockProjection = lockProjection; - return this; - } - - public void unsetLockProjection() { - this.lockProjection = null; - } - - /** Returns true if field lockProjection is set (has been assigned a value) and false otherwise */ - public boolean isSetLockProjection() { - return this.lockProjection != null; - } - - public void setLockProjectionIsSet(boolean value) { - if (!value) { - this.lockProjection = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LOCK_PROJECTION: - if (value == null) { - unsetLockProjection(); - } else { - setLockProjection((LockProjection)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LOCK_PROJECTION: - return getLockProjection(); - - } - 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 LOCK_PROJECTION: - return isSetLockProjection(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof OptionalLockProjection) - return this.equals((OptionalLockProjection)that); - return false; - } - - public boolean equals(OptionalLockProjection that) { - if (that == null) - return false; - - boolean this_present_lockProjection = true && this.isSetLockProjection(); - boolean that_present_lockProjection = true && that.isSetLockProjection(); - if (this_present_lockProjection || that_present_lockProjection) { - if (!(this_present_lockProjection && that_present_lockProjection)) - return false; - if (!this.lockProjection.equals(that.lockProjection)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(OptionalLockProjection other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetLockProjection()).compareTo(other.isSetLockProjection()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLockProjection()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lockProjection, other.lockProjection); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("OptionalLockProjection("); - boolean first = true; - - sb.append("lockProjection:"); - if (this.lockProjection == null) { - sb.append("null"); - } else { - sb.append(this.lockProjection); - } - 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 (lockProjection != null) { - lockProjection.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 OptionalLockProjectionStandardSchemeFactory implements SchemeFactory { - public OptionalLockProjectionStandardScheme getScheme() { - return new OptionalLockProjectionStandardScheme(); - } - } - - private static class OptionalLockProjectionStandardScheme extends StandardScheme<OptionalLockProjection> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OptionalLockProjection 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: // LOCK_PROJECTION - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.lockProjection = new LockProjection(); - struct.lockProjection.read(iprot); - struct.setLockProjectionIsSet(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, OptionalLockProjection struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.lockProjection != null) { - oprot.writeFieldBegin(LOCK_PROJECTION_FIELD_DESC); - struct.lockProjection.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class OptionalLockProjectionTupleSchemeFactory implements SchemeFactory { - public OptionalLockProjectionTupleScheme getScheme() { - return new OptionalLockProjectionTupleScheme(); - } - } - - private static class OptionalLockProjectionTupleScheme extends TupleScheme<OptionalLockProjection> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OptionalLockProjection struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetLockProjection()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetLockProjection()) { - struct.lockProjection.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, OptionalLockProjection struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.lockProjection = new LockProjection(); - struct.lockProjection.read(iprot); - struct.setLockProjectionIsSet(true); - } - } - } - -} -
