public Attach newInstance(Object described)
{
List l = (List) described;
Attach o = new Attach();
if(l.size() <= 2)
{
throw new DecodeException("The role field cannot be omitted");
}
switch(14 - l.size())
{
case 0:
o.setProperties( (Map) l.get( 13 ) );
case 1:
Object val1 = l.get( 12 );
if( val1 == null || val1.getClass().isArray() )
{
o.setDesiredCapabilities( (Symbol[]) val1 );
}
else
{
o.setDesiredCapabilities( (Symbol) val1 );
}
case 2:
Object val2 = l.get( 11 );
if( val2 == null || val2.getClass().isArray() )
{
o.setOfferedCapabilities( (Symbol[]) val2 );
}
else
{
o.setOfferedCapabilities( (Symbol) val2 );
}
case 3:
o.setMaxMessageSize( (UnsignedLong) l.get( 10 ) );
case 4:
o.setInitialDeliveryCount( (UnsignedInteger) l.get( 9 ) );
case 5:
Boolean incompleteUnsettled = (Boolean) l.get(8);
o.setIncompleteUnsettled(incompleteUnsettled == null ? false : incompleteUnsettled);
case 6:
o.setUnsettled( (Map) l.get( 7 ) );
case 7:
o.setTarget( (Target) l.get( 6 ) );
case 8:
o.setSource( (Source) l.get( 5 ) );
case 9:
UnsignedByte rcvSettleMode = (UnsignedByte) l.get(4);
o.setRcvSettleMode(rcvSettleMode == null ? ReceiverSettleMode.FIRST : ReceiverSettleMode.values()[rcvSettleMode.intValue()]);
case 10:
UnsignedByte sndSettleMode = (UnsignedByte) l.get(3);
o.setSndSettleMode(sndSettleMode == null ? SenderSettleMode.MIXED : SenderSettleMode.values()[sndSettleMode.intValue()]);
case 11:
o.setRole( Boolean.TRUE.equals( l.get( 2 ) ) ? Role.RECEIVER : Role.SENDER);
case 12:
o.setHandle( (UnsignedInteger) l.get( 1 ) );
case 13:
o.setName( (String) l.get( 0 ) );
}
return o;
}