public Source newInstance(Object described)
{
List l = (List) described;
Source o = new Source();
switch(11 - l.size())
{
case 0:
Object val0 = l.get( 10 );
if( val0 == null || val0.getClass().isArray() )
{
o.setCapabilities( (Symbol[]) val0 );
}
else
{
o.setCapabilities( (Symbol) val0 );
}
case 1:
Object val1 = l.get( 9 );
if( val1 == null || val1.getClass().isArray() )
{
o.setOutcomes( (Symbol[]) val1 );
}
else
{
o.setOutcomes( (Symbol) val1 );
}
case 2:
o.setDefaultOutcome( (Outcome) l.get( 8 ) );
case 3:
o.setFilter( (Map) l.get( 7 ) );
case 4:
o.setDistributionMode( (Symbol) l.get( 6 ) );
case 5:
o.setDynamicNodeProperties( (Map) l.get( 5 ) );
case 6:
Boolean dynamic = (Boolean) l.get(4);
o.setDynamic(dynamic == null ? false : dynamic);
case 7:
UnsignedInteger timeout = (UnsignedInteger) l.get(3);
o.setTimeout(timeout == null ? UnsignedInteger.ZERO : timeout);
case 8:
Symbol expiryPolicy = (Symbol) l.get(2);
o.setExpiryPolicy(expiryPolicy == null ? TerminusExpiryPolicy.SESSION_END : TerminusExpiryPolicy.valueOf(expiryPolicy));
case 9:
UnsignedInteger durable = (UnsignedInteger) l.get(1);
o.setDurable(durable == null ? TerminusDurability.NONE : TerminusDurability.get(durable));
case 10:
o.setAddress( (String) l.get( 0 ) );
}
return o;
}