/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.xiaomi.infra.galaxy.emq.thrift; import libthrift091.scheme.IScheme; import libthrift091.scheme.SchemeFactory; import libthrift091.scheme.StandardScheme; import libthrift091.scheme.TupleScheme; import libthrift091.protocol.TTupleProtocol; import libthrift091.protocol.TProtocolException; import libthrift091.EncodingUtils; import libthrift091.TException; import libthrift091.async.AsyncMethodCallback; import libthrift091.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 javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) /** * Copyright 2015, Xiaomi. * All rights reserved. * Author: shenyuannan@xiaomi.com */ @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-21") public class QueueAttribute implements libthrift091.TBase<QueueAttribute, QueueAttribute._Fields>, java.io.Serializable, Cloneable, Comparable<QueueAttribute> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("QueueAttribute"); private static final libthrift091.protocol.TField DELAY_SECONDS_FIELD_DESC = new libthrift091.protocol.TField("delaySeconds", libthrift091.protocol.TType.I32, (short)1); private static final libthrift091.protocol.TField INVISIBILITY_SECONDS_FIELD_DESC = new libthrift091.protocol.TField("invisibilitySeconds", libthrift091.protocol.TType.I32, (short)2); private static final libthrift091.protocol.TField RECEIVE_MESSAGE_WAIT_SECONDS_FIELD_DESC = new libthrift091.protocol.TField("receiveMessageWaitSeconds", libthrift091.protocol.TType.I32, (short)3); private static final libthrift091.protocol.TField RECEIVE_MESSAGE_MAXIMUM_NUMBER_FIELD_DESC = new libthrift091.protocol.TField("receiveMessageMaximumNumber", libthrift091.protocol.TType.I32, (short)4); private static final libthrift091.protocol.TField MESSAGE_RETENTION_SECONDS_FIELD_DESC = new libthrift091.protocol.TField("messageRetentionSeconds", libthrift091.protocol.TType.I32, (short)5); private static final libthrift091.protocol.TField MESSAGE_MAXIMUM_BYTES_FIELD_DESC = new libthrift091.protocol.TField("messageMaximumBytes", libthrift091.protocol.TType.I32, (short)6); private static final libthrift091.protocol.TField PARTITION_NUMBER_FIELD_DESC = new libthrift091.protocol.TField("partitionNumber", libthrift091.protocol.TType.I32, (short)7); private static final libthrift091.protocol.TField USER_ATTRIBUTES_FIELD_DESC = new libthrift091.protocol.TField("userAttributes", libthrift091.protocol.TType.MAP, (short)8); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new QueueAttributeStandardSchemeFactory()); schemes.put(TupleScheme.class, new QueueAttributeTupleSchemeFactory()); } /** * Queue delay seconds, message send to this queue will invisible until after * delaySeconds, default 0s (0s ~ 15min) * */ public int delaySeconds; // optional /** * Queue invisibility seconds, after message received form this queue, in * invisibilitySeconds this will not received through receiveMessage. When * after invisibilitySeconds if no deleteMessage called for this message, this * message will receive again, default 30s (2s ~ 12hour) * */ public int invisibilitySeconds; // optional /** * The seconds wait when receiveMessage called, default 0s (0s ~ 20s) * */ public int receiveMessageWaitSeconds; // optional /** * Maximum receive message number in this queue, default 100(1 ~ 100) * */ public int receiveMessageMaximumNumber; // optional /** * message retention seconds in this queue, default 4days (60s ~ 14days) * */ public int messageRetentionSeconds; // optional /** * Max message size in this queue, default 256K (1K ~ 256K) * */ public int messageMaximumBytes; // optional /** * Partition number for this queue default 4 (1 ~ 255) * */ public int partitionNumber; // optional /** * User-defined attributes; * */ public Map<String,String> userAttributes; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { /** * Queue delay seconds, message send to this queue will invisible until after * delaySeconds, default 0s (0s ~ 15min) * */ DELAY_SECONDS((short)1, "delaySeconds"), /** * Queue invisibility seconds, after message received form this queue, in * invisibilitySeconds this will not received through receiveMessage. When * after invisibilitySeconds if no deleteMessage called for this message, this * message will receive again, default 30s (2s ~ 12hour) * */ INVISIBILITY_SECONDS((short)2, "invisibilitySeconds"), /** * The seconds wait when receiveMessage called, default 0s (0s ~ 20s) * */ RECEIVE_MESSAGE_WAIT_SECONDS((short)3, "receiveMessageWaitSeconds"), /** * Maximum receive message number in this queue, default 100(1 ~ 100) * */ RECEIVE_MESSAGE_MAXIMUM_NUMBER((short)4, "receiveMessageMaximumNumber"), /** * message retention seconds in this queue, default 4days (60s ~ 14days) * */ MESSAGE_RETENTION_SECONDS((short)5, "messageRetentionSeconds"), /** * Max message size in this queue, default 256K (1K ~ 256K) * */ MESSAGE_MAXIMUM_BYTES((short)6, "messageMaximumBytes"), /** * Partition number for this queue default 4 (1 ~ 255) * */ PARTITION_NUMBER((short)7, "partitionNumber"), /** * User-defined attributes; * */ USER_ATTRIBUTES((short)8, "userAttributes"); 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: // DELAY_SECONDS return DELAY_SECONDS; case 2: // INVISIBILITY_SECONDS return INVISIBILITY_SECONDS; case 3: // RECEIVE_MESSAGE_WAIT_SECONDS return RECEIVE_MESSAGE_WAIT_SECONDS; case 4: // RECEIVE_MESSAGE_MAXIMUM_NUMBER return RECEIVE_MESSAGE_MAXIMUM_NUMBER; case 5: // MESSAGE_RETENTION_SECONDS return MESSAGE_RETENTION_SECONDS; case 6: // MESSAGE_MAXIMUM_BYTES return MESSAGE_MAXIMUM_BYTES; case 7: // PARTITION_NUMBER return PARTITION_NUMBER; case 8: // USER_ATTRIBUTES return USER_ATTRIBUTES; 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 private static final int __DELAYSECONDS_ISSET_ID = 0; private static final int __INVISIBILITYSECONDS_ISSET_ID = 1; private static final int __RECEIVEMESSAGEWAITSECONDS_ISSET_ID = 2; private static final int __RECEIVEMESSAGEMAXIMUMNUMBER_ISSET_ID = 3; private static final int __MESSAGERETENTIONSECONDS_ISSET_ID = 4; private static final int __MESSAGEMAXIMUMBYTES_ISSET_ID = 5; private static final int __PARTITIONNUMBER_ISSET_ID = 6; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.DELAY_SECONDS,_Fields.INVISIBILITY_SECONDS,_Fields.RECEIVE_MESSAGE_WAIT_SECONDS,_Fields.RECEIVE_MESSAGE_MAXIMUM_NUMBER,_Fields.MESSAGE_RETENTION_SECONDS,_Fields.MESSAGE_MAXIMUM_BYTES,_Fields.PARTITION_NUMBER,_Fields.USER_ATTRIBUTES}; public static final Map<_Fields, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.DELAY_SECONDS, new libthrift091.meta_data.FieldMetaData("delaySeconds", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.INVISIBILITY_SECONDS, new libthrift091.meta_data.FieldMetaData("invisibilitySeconds", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.RECEIVE_MESSAGE_WAIT_SECONDS, new libthrift091.meta_data.FieldMetaData("receiveMessageWaitSeconds", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.RECEIVE_MESSAGE_MAXIMUM_NUMBER, new libthrift091.meta_data.FieldMetaData("receiveMessageMaximumNumber", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.MESSAGE_RETENTION_SECONDS, new libthrift091.meta_data.FieldMetaData("messageRetentionSeconds", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.MESSAGE_MAXIMUM_BYTES, new libthrift091.meta_data.FieldMetaData("messageMaximumBytes", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.PARTITION_NUMBER, new libthrift091.meta_data.FieldMetaData("partitionNumber", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.USER_ATTRIBUTES, new libthrift091.meta_data.FieldMetaData("userAttributes", libthrift091.TFieldRequirementType.OPTIONAL, new libthrift091.meta_data.MapMetaData(libthrift091.protocol.TType.MAP, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING), new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(QueueAttribute.class, metaDataMap); } public QueueAttribute() { } /** * Performs a deep copy on <i>other</i>. */ public QueueAttribute(QueueAttribute other) { __isset_bitfield = other.__isset_bitfield; this.delaySeconds = other.delaySeconds; this.invisibilitySeconds = other.invisibilitySeconds; this.receiveMessageWaitSeconds = other.receiveMessageWaitSeconds; this.receiveMessageMaximumNumber = other.receiveMessageMaximumNumber; this.messageRetentionSeconds = other.messageRetentionSeconds; this.messageMaximumBytes = other.messageMaximumBytes; this.partitionNumber = other.partitionNumber; if (other.isSetUserAttributes()) { Map<String,String> __this__userAttributes = new HashMap<String,String>(other.userAttributes); this.userAttributes = __this__userAttributes; } } public QueueAttribute deepCopy() { return new QueueAttribute(this); } @Override public void clear() { setDelaySecondsIsSet(false); this.delaySeconds = 0; setInvisibilitySecondsIsSet(false); this.invisibilitySeconds = 0; setReceiveMessageWaitSecondsIsSet(false); this.receiveMessageWaitSeconds = 0; setReceiveMessageMaximumNumberIsSet(false); this.receiveMessageMaximumNumber = 0; setMessageRetentionSecondsIsSet(false); this.messageRetentionSeconds = 0; setMessageMaximumBytesIsSet(false); this.messageMaximumBytes = 0; setPartitionNumberIsSet(false); this.partitionNumber = 0; this.userAttributes = null; } /** * Queue delay seconds, message send to this queue will invisible until after * delaySeconds, default 0s (0s ~ 15min) * */ public int getDelaySeconds() { return this.delaySeconds; } /** * Queue delay seconds, message send to this queue will invisible until after * delaySeconds, default 0s (0s ~ 15min) * */ public QueueAttribute setDelaySeconds(int delaySeconds) { this.delaySeconds = delaySeconds; setDelaySecondsIsSet(true); return this; } public void unsetDelaySeconds() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DELAYSECONDS_ISSET_ID); } /** Returns true if field delaySeconds is set (has been assigned a value) and false otherwise */ public boolean isSetDelaySeconds() { return EncodingUtils.testBit(__isset_bitfield, __DELAYSECONDS_ISSET_ID); } public void setDelaySecondsIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DELAYSECONDS_ISSET_ID, value); } /** * Queue invisibility seconds, after message received form this queue, in * invisibilitySeconds this will not received through receiveMessage. When * after invisibilitySeconds if no deleteMessage called for this message, this * message will receive again, default 30s (2s ~ 12hour) * */ public int getInvisibilitySeconds() { return this.invisibilitySeconds; } /** * Queue invisibility seconds, after message received form this queue, in * invisibilitySeconds this will not received through receiveMessage. When * after invisibilitySeconds if no deleteMessage called for this message, this * message will receive again, default 30s (2s ~ 12hour) * */ public QueueAttribute setInvisibilitySeconds(int invisibilitySeconds) { this.invisibilitySeconds = invisibilitySeconds; setInvisibilitySecondsIsSet(true); return this; } public void unsetInvisibilitySeconds() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INVISIBILITYSECONDS_ISSET_ID); } /** Returns true if field invisibilitySeconds is set (has been assigned a value) and false otherwise */ public boolean isSetInvisibilitySeconds() { return EncodingUtils.testBit(__isset_bitfield, __INVISIBILITYSECONDS_ISSET_ID); } public void setInvisibilitySecondsIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INVISIBILITYSECONDS_ISSET_ID, value); } /** * The seconds wait when receiveMessage called, default 0s (0s ~ 20s) * */ public int getReceiveMessageWaitSeconds() { return this.receiveMessageWaitSeconds; } /** * The seconds wait when receiveMessage called, default 0s (0s ~ 20s) * */ public QueueAttribute setReceiveMessageWaitSeconds(int receiveMessageWaitSeconds) { this.receiveMessageWaitSeconds = receiveMessageWaitSeconds; setReceiveMessageWaitSecondsIsSet(true); return this; } public void unsetReceiveMessageWaitSeconds() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECEIVEMESSAGEWAITSECONDS_ISSET_ID); } /** Returns true if field receiveMessageWaitSeconds is set (has been assigned a value) and false otherwise */ public boolean isSetReceiveMessageWaitSeconds() { return EncodingUtils.testBit(__isset_bitfield, __RECEIVEMESSAGEWAITSECONDS_ISSET_ID); } public void setReceiveMessageWaitSecondsIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECEIVEMESSAGEWAITSECONDS_ISSET_ID, value); } /** * Maximum receive message number in this queue, default 100(1 ~ 100) * */ public int getReceiveMessageMaximumNumber() { return this.receiveMessageMaximumNumber; } /** * Maximum receive message number in this queue, default 100(1 ~ 100) * */ public QueueAttribute setReceiveMessageMaximumNumber(int receiveMessageMaximumNumber) { this.receiveMessageMaximumNumber = receiveMessageMaximumNumber; setReceiveMessageMaximumNumberIsSet(true); return this; } public void unsetReceiveMessageMaximumNumber() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECEIVEMESSAGEMAXIMUMNUMBER_ISSET_ID); } /** Returns true if field receiveMessageMaximumNumber is set (has been assigned a value) and false otherwise */ public boolean isSetReceiveMessageMaximumNumber() { return EncodingUtils.testBit(__isset_bitfield, __RECEIVEMESSAGEMAXIMUMNUMBER_ISSET_ID); } public void setReceiveMessageMaximumNumberIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECEIVEMESSAGEMAXIMUMNUMBER_ISSET_ID, value); } /** * message retention seconds in this queue, default 4days (60s ~ 14days) * */ public int getMessageRetentionSeconds() { return this.messageRetentionSeconds; } /** * message retention seconds in this queue, default 4days (60s ~ 14days) * */ public QueueAttribute setMessageRetentionSeconds(int messageRetentionSeconds) { this.messageRetentionSeconds = messageRetentionSeconds; setMessageRetentionSecondsIsSet(true); return this; } public void unsetMessageRetentionSeconds() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MESSAGERETENTIONSECONDS_ISSET_ID); } /** Returns true if field messageRetentionSeconds is set (has been assigned a value) and false otherwise */ public boolean isSetMessageRetentionSeconds() { return EncodingUtils.testBit(__isset_bitfield, __MESSAGERETENTIONSECONDS_ISSET_ID); } public void setMessageRetentionSecondsIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MESSAGERETENTIONSECONDS_ISSET_ID, value); } /** * Max message size in this queue, default 256K (1K ~ 256K) * */ public int getMessageMaximumBytes() { return this.messageMaximumBytes; } /** * Max message size in this queue, default 256K (1K ~ 256K) * */ public QueueAttribute setMessageMaximumBytes(int messageMaximumBytes) { this.messageMaximumBytes = messageMaximumBytes; setMessageMaximumBytesIsSet(true); return this; } public void unsetMessageMaximumBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MESSAGEMAXIMUMBYTES_ISSET_ID); } /** Returns true if field messageMaximumBytes is set (has been assigned a value) and false otherwise */ public boolean isSetMessageMaximumBytes() { return EncodingUtils.testBit(__isset_bitfield, __MESSAGEMAXIMUMBYTES_ISSET_ID); } public void setMessageMaximumBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MESSAGEMAXIMUMBYTES_ISSET_ID, value); } /** * Partition number for this queue default 4 (1 ~ 255) * */ public int getPartitionNumber() { return this.partitionNumber; } /** * Partition number for this queue default 4 (1 ~ 255) * */ public QueueAttribute setPartitionNumber(int partitionNumber) { this.partitionNumber = partitionNumber; setPartitionNumberIsSet(true); return this; } public void unsetPartitionNumber() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARTITIONNUMBER_ISSET_ID); } /** Returns true if field partitionNumber is set (has been assigned a value) and false otherwise */ public boolean isSetPartitionNumber() { return EncodingUtils.testBit(__isset_bitfield, __PARTITIONNUMBER_ISSET_ID); } public void setPartitionNumberIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARTITIONNUMBER_ISSET_ID, value); } public int getUserAttributesSize() { return (this.userAttributes == null) ? 0 : this.userAttributes.size(); } public void putToUserAttributes(String key, String val) { if (this.userAttributes == null) { this.userAttributes = new HashMap<String,String>(); } this.userAttributes.put(key, val); } /** * User-defined attributes; * */ public Map<String,String> getUserAttributes() { return this.userAttributes; } /** * User-defined attributes; * */ public QueueAttribute setUserAttributes(Map<String,String> userAttributes) { this.userAttributes = userAttributes; return this; } public void unsetUserAttributes() { this.userAttributes = null; } /** Returns true if field userAttributes is set (has been assigned a value) and false otherwise */ public boolean isSetUserAttributes() { return this.userAttributes != null; } public void setUserAttributesIsSet(boolean value) { if (!value) { this.userAttributes = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case DELAY_SECONDS: if (value == null) { unsetDelaySeconds(); } else { setDelaySeconds((Integer)value); } break; case INVISIBILITY_SECONDS: if (value == null) { unsetInvisibilitySeconds(); } else { setInvisibilitySeconds((Integer)value); } break; case RECEIVE_MESSAGE_WAIT_SECONDS: if (value == null) { unsetReceiveMessageWaitSeconds(); } else { setReceiveMessageWaitSeconds((Integer)value); } break; case RECEIVE_MESSAGE_MAXIMUM_NUMBER: if (value == null) { unsetReceiveMessageMaximumNumber(); } else { setReceiveMessageMaximumNumber((Integer)value); } break; case MESSAGE_RETENTION_SECONDS: if (value == null) { unsetMessageRetentionSeconds(); } else { setMessageRetentionSeconds((Integer)value); } break; case MESSAGE_MAXIMUM_BYTES: if (value == null) { unsetMessageMaximumBytes(); } else { setMessageMaximumBytes((Integer)value); } break; case PARTITION_NUMBER: if (value == null) { unsetPartitionNumber(); } else { setPartitionNumber((Integer)value); } break; case USER_ATTRIBUTES: if (value == null) { unsetUserAttributes(); } else { setUserAttributes((Map<String,String>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DELAY_SECONDS: return Integer.valueOf(getDelaySeconds()); case INVISIBILITY_SECONDS: return Integer.valueOf(getInvisibilitySeconds()); case RECEIVE_MESSAGE_WAIT_SECONDS: return Integer.valueOf(getReceiveMessageWaitSeconds()); case RECEIVE_MESSAGE_MAXIMUM_NUMBER: return Integer.valueOf(getReceiveMessageMaximumNumber()); case MESSAGE_RETENTION_SECONDS: return Integer.valueOf(getMessageRetentionSeconds()); case MESSAGE_MAXIMUM_BYTES: return Integer.valueOf(getMessageMaximumBytes()); case PARTITION_NUMBER: return Integer.valueOf(getPartitionNumber()); case USER_ATTRIBUTES: return getUserAttributes(); } 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 DELAY_SECONDS: return isSetDelaySeconds(); case INVISIBILITY_SECONDS: return isSetInvisibilitySeconds(); case RECEIVE_MESSAGE_WAIT_SECONDS: return isSetReceiveMessageWaitSeconds(); case RECEIVE_MESSAGE_MAXIMUM_NUMBER: return isSetReceiveMessageMaximumNumber(); case MESSAGE_RETENTION_SECONDS: return isSetMessageRetentionSeconds(); case MESSAGE_MAXIMUM_BYTES: return isSetMessageMaximumBytes(); case PARTITION_NUMBER: return isSetPartitionNumber(); case USER_ATTRIBUTES: return isSetUserAttributes(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof QueueAttribute) return this.equals((QueueAttribute)that); return false; } public boolean equals(QueueAttribute that) { if (that == null) return false; boolean this_present_delaySeconds = true && this.isSetDelaySeconds(); boolean that_present_delaySeconds = true && that.isSetDelaySeconds(); if (this_present_delaySeconds || that_present_delaySeconds) { if (!(this_present_delaySeconds && that_present_delaySeconds)) return false; if (this.delaySeconds != that.delaySeconds) return false; } boolean this_present_invisibilitySeconds = true && this.isSetInvisibilitySeconds(); boolean that_present_invisibilitySeconds = true && that.isSetInvisibilitySeconds(); if (this_present_invisibilitySeconds || that_present_invisibilitySeconds) { if (!(this_present_invisibilitySeconds && that_present_invisibilitySeconds)) return false; if (this.invisibilitySeconds != that.invisibilitySeconds) return false; } boolean this_present_receiveMessageWaitSeconds = true && this.isSetReceiveMessageWaitSeconds(); boolean that_present_receiveMessageWaitSeconds = true && that.isSetReceiveMessageWaitSeconds(); if (this_present_receiveMessageWaitSeconds || that_present_receiveMessageWaitSeconds) { if (!(this_present_receiveMessageWaitSeconds && that_present_receiveMessageWaitSeconds)) return false; if (this.receiveMessageWaitSeconds != that.receiveMessageWaitSeconds) return false; } boolean this_present_receiveMessageMaximumNumber = true && this.isSetReceiveMessageMaximumNumber(); boolean that_present_receiveMessageMaximumNumber = true && that.isSetReceiveMessageMaximumNumber(); if (this_present_receiveMessageMaximumNumber || that_present_receiveMessageMaximumNumber) { if (!(this_present_receiveMessageMaximumNumber && that_present_receiveMessageMaximumNumber)) return false; if (this.receiveMessageMaximumNumber != that.receiveMessageMaximumNumber) return false; } boolean this_present_messageRetentionSeconds = true && this.isSetMessageRetentionSeconds(); boolean that_present_messageRetentionSeconds = true && that.isSetMessageRetentionSeconds(); if (this_present_messageRetentionSeconds || that_present_messageRetentionSeconds) { if (!(this_present_messageRetentionSeconds && that_present_messageRetentionSeconds)) return false; if (this.messageRetentionSeconds != that.messageRetentionSeconds) return false; } boolean this_present_messageMaximumBytes = true && this.isSetMessageMaximumBytes(); boolean that_present_messageMaximumBytes = true && that.isSetMessageMaximumBytes(); if (this_present_messageMaximumBytes || that_present_messageMaximumBytes) { if (!(this_present_messageMaximumBytes && that_present_messageMaximumBytes)) return false; if (this.messageMaximumBytes != that.messageMaximumBytes) return false; } boolean this_present_partitionNumber = true && this.isSetPartitionNumber(); boolean that_present_partitionNumber = true && that.isSetPartitionNumber(); if (this_present_partitionNumber || that_present_partitionNumber) { if (!(this_present_partitionNumber && that_present_partitionNumber)) return false; if (this.partitionNumber != that.partitionNumber) return false; } boolean this_present_userAttributes = true && this.isSetUserAttributes(); boolean that_present_userAttributes = true && that.isSetUserAttributes(); if (this_present_userAttributes || that_present_userAttributes) { if (!(this_present_userAttributes && that_present_userAttributes)) return false; if (!this.userAttributes.equals(that.userAttributes)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_delaySeconds = true && (isSetDelaySeconds()); list.add(present_delaySeconds); if (present_delaySeconds) list.add(delaySeconds); boolean present_invisibilitySeconds = true && (isSetInvisibilitySeconds()); list.add(present_invisibilitySeconds); if (present_invisibilitySeconds) list.add(invisibilitySeconds); boolean present_receiveMessageWaitSeconds = true && (isSetReceiveMessageWaitSeconds()); list.add(present_receiveMessageWaitSeconds); if (present_receiveMessageWaitSeconds) list.add(receiveMessageWaitSeconds); boolean present_receiveMessageMaximumNumber = true && (isSetReceiveMessageMaximumNumber()); list.add(present_receiveMessageMaximumNumber); if (present_receiveMessageMaximumNumber) list.add(receiveMessageMaximumNumber); boolean present_messageRetentionSeconds = true && (isSetMessageRetentionSeconds()); list.add(present_messageRetentionSeconds); if (present_messageRetentionSeconds) list.add(messageRetentionSeconds); boolean present_messageMaximumBytes = true && (isSetMessageMaximumBytes()); list.add(present_messageMaximumBytes); if (present_messageMaximumBytes) list.add(messageMaximumBytes); boolean present_partitionNumber = true && (isSetPartitionNumber()); list.add(present_partitionNumber); if (present_partitionNumber) list.add(partitionNumber); boolean present_userAttributes = true && (isSetUserAttributes()); list.add(present_userAttributes); if (present_userAttributes) list.add(userAttributes); return list.hashCode(); } @Override public int compareTo(QueueAttribute other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetDelaySeconds()).compareTo(other.isSetDelaySeconds()); if (lastComparison != 0) { return lastComparison; } if (isSetDelaySeconds()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.delaySeconds, other.delaySeconds); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetInvisibilitySeconds()).compareTo(other.isSetInvisibilitySeconds()); if (lastComparison != 0) { return lastComparison; } if (isSetInvisibilitySeconds()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.invisibilitySeconds, other.invisibilitySeconds); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetReceiveMessageWaitSeconds()).compareTo(other.isSetReceiveMessageWaitSeconds()); if (lastComparison != 0) { return lastComparison; } if (isSetReceiveMessageWaitSeconds()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.receiveMessageWaitSeconds, other.receiveMessageWaitSeconds); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetReceiveMessageMaximumNumber()).compareTo(other.isSetReceiveMessageMaximumNumber()); if (lastComparison != 0) { return lastComparison; } if (isSetReceiveMessageMaximumNumber()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.receiveMessageMaximumNumber, other.receiveMessageMaximumNumber); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMessageRetentionSeconds()).compareTo(other.isSetMessageRetentionSeconds()); if (lastComparison != 0) { return lastComparison; } if (isSetMessageRetentionSeconds()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.messageRetentionSeconds, other.messageRetentionSeconds); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMessageMaximumBytes()).compareTo(other.isSetMessageMaximumBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetMessageMaximumBytes()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.messageMaximumBytes, other.messageMaximumBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPartitionNumber()).compareTo(other.isSetPartitionNumber()); if (lastComparison != 0) { return lastComparison; } if (isSetPartitionNumber()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.partitionNumber, other.partitionNumber); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUserAttributes()).compareTo(other.isSetUserAttributes()); if (lastComparison != 0) { return lastComparison; } if (isSetUserAttributes()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.userAttributes, other.userAttributes); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("QueueAttribute("); boolean first = true; if (isSetDelaySeconds()) { sb.append("delaySeconds:"); sb.append(this.delaySeconds); first = false; } if (isSetInvisibilitySeconds()) { if (!first) sb.append(", "); sb.append("invisibilitySeconds:"); sb.append(this.invisibilitySeconds); first = false; } if (isSetReceiveMessageWaitSeconds()) { if (!first) sb.append(", "); sb.append("receiveMessageWaitSeconds:"); sb.append(this.receiveMessageWaitSeconds); first = false; } if (isSetReceiveMessageMaximumNumber()) { if (!first) sb.append(", "); sb.append("receiveMessageMaximumNumber:"); sb.append(this.receiveMessageMaximumNumber); first = false; } if (isSetMessageRetentionSeconds()) { if (!first) sb.append(", "); sb.append("messageRetentionSeconds:"); sb.append(this.messageRetentionSeconds); first = false; } if (isSetMessageMaximumBytes()) { if (!first) sb.append(", "); sb.append("messageMaximumBytes:"); sb.append(this.messageMaximumBytes); first = false; } if (isSetPartitionNumber()) { if (!first) sb.append(", "); sb.append("partitionNumber:"); sb.append(this.partitionNumber); first = false; } if (isSetUserAttributes()) { if (!first) sb.append(", "); sb.append("userAttributes:"); if (this.userAttributes == null) { sb.append("null"); } else { sb.append(this.userAttributes); } first = false; } sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class QueueAttributeStandardSchemeFactory implements SchemeFactory { public QueueAttributeStandardScheme getScheme() { return new QueueAttributeStandardScheme(); } } private static class QueueAttributeStandardScheme extends StandardScheme<QueueAttribute> { public void read(libthrift091.protocol.TProtocol iprot, QueueAttribute struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DELAY_SECONDS if (schemeField.type == libthrift091.protocol.TType.I32) { struct.delaySeconds = iprot.readI32(); struct.setDelaySecondsIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // INVISIBILITY_SECONDS if (schemeField.type == libthrift091.protocol.TType.I32) { struct.invisibilitySeconds = iprot.readI32(); struct.setInvisibilitySecondsIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // RECEIVE_MESSAGE_WAIT_SECONDS if (schemeField.type == libthrift091.protocol.TType.I32) { struct.receiveMessageWaitSeconds = iprot.readI32(); struct.setReceiveMessageWaitSecondsIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // RECEIVE_MESSAGE_MAXIMUM_NUMBER if (schemeField.type == libthrift091.protocol.TType.I32) { struct.receiveMessageMaximumNumber = iprot.readI32(); struct.setReceiveMessageMaximumNumberIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // MESSAGE_RETENTION_SECONDS if (schemeField.type == libthrift091.protocol.TType.I32) { struct.messageRetentionSeconds = iprot.readI32(); struct.setMessageRetentionSecondsIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // MESSAGE_MAXIMUM_BYTES if (schemeField.type == libthrift091.protocol.TType.I32) { struct.messageMaximumBytes = iprot.readI32(); struct.setMessageMaximumBytesIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // PARTITION_NUMBER if (schemeField.type == libthrift091.protocol.TType.I32) { struct.partitionNumber = iprot.readI32(); struct.setPartitionNumberIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // USER_ATTRIBUTES if (schemeField.type == libthrift091.protocol.TType.MAP) { { libthrift091.protocol.TMap _map0 = iprot.readMapBegin(); struct.userAttributes = new HashMap<String,String>(2*_map0.size); String _key1; String _val2; for (int _i3 = 0; _i3 < _map0.size; ++_i3) { _key1 = iprot.readString(); _val2 = iprot.readString(); struct.userAttributes.put(_key1, _val2); } iprot.readMapEnd(); } struct.setUserAttributesIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.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(libthrift091.protocol.TProtocol oprot, QueueAttribute struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetDelaySeconds()) { oprot.writeFieldBegin(DELAY_SECONDS_FIELD_DESC); oprot.writeI32(struct.delaySeconds); oprot.writeFieldEnd(); } if (struct.isSetInvisibilitySeconds()) { oprot.writeFieldBegin(INVISIBILITY_SECONDS_FIELD_DESC); oprot.writeI32(struct.invisibilitySeconds); oprot.writeFieldEnd(); } if (struct.isSetReceiveMessageWaitSeconds()) { oprot.writeFieldBegin(RECEIVE_MESSAGE_WAIT_SECONDS_FIELD_DESC); oprot.writeI32(struct.receiveMessageWaitSeconds); oprot.writeFieldEnd(); } if (struct.isSetReceiveMessageMaximumNumber()) { oprot.writeFieldBegin(RECEIVE_MESSAGE_MAXIMUM_NUMBER_FIELD_DESC); oprot.writeI32(struct.receiveMessageMaximumNumber); oprot.writeFieldEnd(); } if (struct.isSetMessageRetentionSeconds()) { oprot.writeFieldBegin(MESSAGE_RETENTION_SECONDS_FIELD_DESC); oprot.writeI32(struct.messageRetentionSeconds); oprot.writeFieldEnd(); } if (struct.isSetMessageMaximumBytes()) { oprot.writeFieldBegin(MESSAGE_MAXIMUM_BYTES_FIELD_DESC); oprot.writeI32(struct.messageMaximumBytes); oprot.writeFieldEnd(); } if (struct.isSetPartitionNumber()) { oprot.writeFieldBegin(PARTITION_NUMBER_FIELD_DESC); oprot.writeI32(struct.partitionNumber); oprot.writeFieldEnd(); } if (struct.userAttributes != null) { if (struct.isSetUserAttributes()) { oprot.writeFieldBegin(USER_ATTRIBUTES_FIELD_DESC); { oprot.writeMapBegin(new libthrift091.protocol.TMap(libthrift091.protocol.TType.STRING, libthrift091.protocol.TType.STRING, struct.userAttributes.size())); for (Map.Entry<String, String> _iter4 : struct.userAttributes.entrySet()) { oprot.writeString(_iter4.getKey()); oprot.writeString(_iter4.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class QueueAttributeTupleSchemeFactory implements SchemeFactory { public QueueAttributeTupleScheme getScheme() { return new QueueAttributeTupleScheme(); } } private static class QueueAttributeTupleScheme extends TupleScheme<QueueAttribute> { @Override public void write(libthrift091.protocol.TProtocol prot, QueueAttribute struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDelaySeconds()) { optionals.set(0); } if (struct.isSetInvisibilitySeconds()) { optionals.set(1); } if (struct.isSetReceiveMessageWaitSeconds()) { optionals.set(2); } if (struct.isSetReceiveMessageMaximumNumber()) { optionals.set(3); } if (struct.isSetMessageRetentionSeconds()) { optionals.set(4); } if (struct.isSetMessageMaximumBytes()) { optionals.set(5); } if (struct.isSetPartitionNumber()) { optionals.set(6); } if (struct.isSetUserAttributes()) { optionals.set(7); } oprot.writeBitSet(optionals, 8); if (struct.isSetDelaySeconds()) { oprot.writeI32(struct.delaySeconds); } if (struct.isSetInvisibilitySeconds()) { oprot.writeI32(struct.invisibilitySeconds); } if (struct.isSetReceiveMessageWaitSeconds()) { oprot.writeI32(struct.receiveMessageWaitSeconds); } if (struct.isSetReceiveMessageMaximumNumber()) { oprot.writeI32(struct.receiveMessageMaximumNumber); } if (struct.isSetMessageRetentionSeconds()) { oprot.writeI32(struct.messageRetentionSeconds); } if (struct.isSetMessageMaximumBytes()) { oprot.writeI32(struct.messageMaximumBytes); } if (struct.isSetPartitionNumber()) { oprot.writeI32(struct.partitionNumber); } if (struct.isSetUserAttributes()) { { oprot.writeI32(struct.userAttributes.size()); for (Map.Entry<String, String> _iter5 : struct.userAttributes.entrySet()) { oprot.writeString(_iter5.getKey()); oprot.writeString(_iter5.getValue()); } } } } @Override public void read(libthrift091.protocol.TProtocol prot, QueueAttribute struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.delaySeconds = iprot.readI32(); struct.setDelaySecondsIsSet(true); } if (incoming.get(1)) { struct.invisibilitySeconds = iprot.readI32(); struct.setInvisibilitySecondsIsSet(true); } if (incoming.get(2)) { struct.receiveMessageWaitSeconds = iprot.readI32(); struct.setReceiveMessageWaitSecondsIsSet(true); } if (incoming.get(3)) { struct.receiveMessageMaximumNumber = iprot.readI32(); struct.setReceiveMessageMaximumNumberIsSet(true); } if (incoming.get(4)) { struct.messageRetentionSeconds = iprot.readI32(); struct.setMessageRetentionSecondsIsSet(true); } if (incoming.get(5)) { struct.messageMaximumBytes = iprot.readI32(); struct.setMessageMaximumBytesIsSet(true); } if (incoming.get(6)) { struct.partitionNumber = iprot.readI32(); struct.setPartitionNumberIsSet(true); } if (incoming.get(7)) { { libthrift091.protocol.TMap _map6 = new libthrift091.protocol.TMap(libthrift091.protocol.TType.STRING, libthrift091.protocol.TType.STRING, iprot.readI32()); struct.userAttributes = new HashMap<String,String>(2*_map6.size); String _key7; String _val8; for (int _i9 = 0; _i9 < _map6.size; ++_i9) { _key7 = iprot.readString(); _val8 = iprot.readString(); struct.userAttributes.put(_key7, _val8); } } struct.setUserAttributesIsSet(true); } } } }