private static AmqpNmsMessageFacade CreateWithoutAnnotation()

in src/NMS.AMQP/Provider/Amqp/Message/AmqpCodec.cs [79:111]


        private static AmqpNmsMessageFacade CreateWithoutAnnotation(RestrictedDescribed body, Properties properties)
        {
            Symbol contentType = GetContentType(properties);

            if (body is Data || body is null)
            {
                if (IsContentType(SymbolUtil.OCTET_STREAM_CONTENT_TYPE, contentType) || IsContentType(null, contentType))
                    return new AmqpNmsBytesMessageFacade();
                else if (IsContentType(SymbolUtil.SERIALIZED_DOTNET_OBJECT_CONTENT_TYPE, contentType))
                    return new AmqpNmsObjectMessageFacade();
                else
                {
                    if (IsTextualContent(contentType))
                        return new AmqpNmsTextMessageFacade();
                    else
                        return new AmqpNmsBytesMessageFacade();
                }
            }
            else if (body is AmqpValue amqpValue)
            {
                object value = amqpValue.Value;
                if (value == null || value is string)
                    return new AmqpNmsTextMessageFacade();
                else if (value is byte[])
                    return new AmqpNmsBytesMessageFacade();
                else
                    return new AmqpNmsObjectMessageFacade();
            }
            else if (body is AmqpSequence)
                return new AmqpNmsObjectMessageFacade();

            return null;
        }