public Open newInstance(Object described)
{
List l = (List) described;
Open o = new Open();
if(l.isEmpty())
{
throw new DecodeException("The container-id field cannot be omitted");
}
switch(10 - l.size())
{
case 0:
o.setProperties( (Map) l.get( 9 ) );
case 1:
Object val1 = l.get( 8 );
if( val1 == null || val1.getClass().isArray() )
{
o.setDesiredCapabilities( (Symbol[]) val1 );
}
else
{
o.setDesiredCapabilities( (Symbol) val1 );
}
case 2:
Object val2 = l.get( 7 );
if( val2 == null || val2.getClass().isArray() )
{
o.setOfferedCapabilities( (Symbol[]) val2 );
}
else
{
o.setOfferedCapabilities( (Symbol) val2 );
}
case 3:
Object val3 = l.get( 6 );
if( val3 == null || val3.getClass().isArray() )
{
o.setIncomingLocales( (Symbol[]) val3 );
}
else
{
o.setIncomingLocales( (Symbol) val3 );
}
case 4:
Object val4 = l.get( 5 );
if( val4 == null || val4.getClass().isArray() )
{
o.setOutgoingLocales( (Symbol[]) val4 );
}
else
{
o.setOutgoingLocales( (Symbol) val4 );
}
case 5:
o.setIdleTimeOut( (UnsignedInteger) l.get( 4 ) );
case 6:
UnsignedShort channelMax = (UnsignedShort) l.get(3);
o.setChannelMax(channelMax == null ? UnsignedShort.MAX_VALUE : channelMax);
case 7:
UnsignedInteger maxFrameSize = (UnsignedInteger) l.get(2);
o.setMaxFrameSize(maxFrameSize == null ? UnsignedInteger.MAX_VALUE : maxFrameSize);
case 8:
o.setHostname( (String) l.get( 1 ) );
case 9:
o.setContainerId( (String) l.get( 0 ) );
}
return o;
}