diff options
author | Simon Rettberg | 2015-08-14 15:31:12 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-08-14 15:31:12 +0200 |
commit | 19688656134b288fd981730544dde303c9c3afd9 (patch) | |
tree | 99ee404d2f08e46c024318d95169495d9b9258e3 /src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java | |
parent | Use connection pool in thrift manager, allow getting explicit sat connection (diff) | |
download | master-sync-shared-19688656134b288fd981730544dde303c9c3afd9.tar.gz master-sync-shared-19688656134b288fd981730544dde303c9c3afd9.tar.xz master-sync-shared-19688656134b288fd981730544dde303c9c3afd9.zip |
Thrift api changes
Diffstat (limited to 'src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java')
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java | 110 |
1 files changed, 109 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java b/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java index 25690bd..03c0643 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java @@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory; public class TNotFoundException extends TException implements org.apache.thrift.TBase<TNotFoundException, TNotFoundException._Fields>, java.io.Serializable, Cloneable, Comparable<TNotFoundException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TNotFoundException"); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -42,10 +43,11 @@ public class TNotFoundException extends TException implements org.apache.thrift. schemes.put(TupleScheme.class, new TNotFoundExceptionTupleSchemeFactory()); } + public String message; // 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 { -; + MESSAGE((short)1, "message"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -60,6 +62,8 @@ public class TNotFoundException extends TException implements org.apache.thrift. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // MESSAGE + return MESSAGE; default: return null; } @@ -98,9 +102,13 @@ public class TNotFoundException extends TException implements org.apache.thrift. 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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(TNotFoundException.class, metaDataMap); } @@ -108,10 +116,20 @@ public class TNotFoundException extends TException implements org.apache.thrift. public TNotFoundException() { } + public TNotFoundException( + String message) + { + this(); + this.message = message; + } + /** * Performs a deep copy on <i>other</i>. */ public TNotFoundException(TNotFoundException other) { + if (other.isSetMessage()) { + this.message = other.message; + } } public TNotFoundException deepCopy() { @@ -120,15 +138,51 @@ public class TNotFoundException extends TException implements org.apache.thrift. @Override public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public TNotFoundException setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + } } public Object getFieldValue(_Fields field) { switch (field) { + case MESSAGE: + return getMessage(); + } throw new IllegalStateException(); } @@ -140,6 +194,8 @@ public class TNotFoundException extends TException implements org.apache.thrift. } switch (field) { + case MESSAGE: + return isSetMessage(); } throw new IllegalStateException(); } @@ -157,6 +213,15 @@ public class TNotFoundException extends TException implements org.apache.thrift. if (that == null) return false; + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + return true; } @@ -173,6 +238,16 @@ public class TNotFoundException extends TException implements org.apache.thrift. int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -193,6 +268,13 @@ public class TNotFoundException extends TException implements org.apache.thrift. StringBuilder sb = new StringBuilder("TNotFoundException("); boolean first = true; + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; sb.append(")"); return sb.toString(); } @@ -236,6 +318,14 @@ public class TNotFoundException extends TException implements org.apache.thrift. break; } switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -251,6 +341,11 @@ public class TNotFoundException extends TException implements org.apache.thrift. struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -268,11 +363,24 @@ public class TNotFoundException extends TException implements org.apache.thrift. @Override public void write(org.apache.thrift.protocol.TProtocol prot, TNotFoundException struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TNotFoundException struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } } } |