use of com.swiftmq.amqp.v100.generated.transport.definitions.Role in project swiftmq-client by iitsoftware.
the class DispositionFrame method decode.
private void decode() throws Exception {
List l = body.getValue();
AMQPType t = null;
int idx = 0;
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'role' in 'Disposition' frame is NULL");
try {
role = new Role(((AMQPBoolean) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'role' in 'Disposition' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'first' in 'Disposition' frame is NULL");
try {
first = new DeliveryNumber(((AMQPUnsignedInt) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'first' in 'Disposition' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
last = new DeliveryNumber(((AMQPUnsignedInt) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'last' in 'Disposition' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
settled = (AMQPBoolean) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'settled' in 'Disposition' frame: " + e);
}
// Factory : DeliveryStateFactory
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() != AMQPTypeDecoder.NULL)
state = DeliveryStateFactory.create(t);
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
batchable = (AMQPBoolean) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'batchable' in 'Disposition' frame: " + e);
}
}
Aggregations