3131
3232using System ;
3333using System . Collections . Generic ;
34+ using System . Diagnostics . CodeAnalysis ;
3435using RabbitMQ . Client . Framing . Impl ;
3536using RabbitMQ . Client . Impl ;
3637
3738namespace RabbitMQ . Client
3839{
39- #nullable enable
4040 /// <summary>
4141 /// AMQP specification content header properties for content class "basic".
4242 /// </summary>
@@ -74,7 +74,7 @@ public PublicationAddress? ReplyToAddress
7474 {
7575 get
7676 {
77- PublicationAddress . TryParse ( ReplyTo , out PublicationAddress result ) ;
77+ PublicationAddress . TryParse ( ReplyTo , out PublicationAddress ? result ) ;
7878 return result ;
7979 }
8080
@@ -85,7 +85,7 @@ public BasicProperties()
8585 {
8686 }
8787
88- public BasicProperties ( ReadOnlyBasicProperties input )
88+ public BasicProperties ( IReadOnlyBasicProperties input )
8989 {
9090 ContentType = input . ContentType ;
9191 ContentEncoding = input . ContentEncoding ;
@@ -118,19 +118,30 @@ public BasicProperties(ReadOnlyBasicProperties input)
118118 public void ClearAppId ( ) => AppId = default ;
119119 public void ClearClusterId ( ) => ClusterId = default ;
120120
121+ [ MemberNotNullWhen ( true , nameof ( ContentType ) ) ]
121122 public bool IsContentTypePresent ( ) => ContentType != default ;
123+ [ MemberNotNullWhen ( true , nameof ( ContentEncoding ) ) ]
122124 public bool IsContentEncodingPresent ( ) => ContentEncoding != default ;
125+ [ MemberNotNullWhen ( true , nameof ( Headers ) ) ]
123126 public bool IsHeadersPresent ( ) => Headers != default ;
124127 public bool IsDeliveryModePresent ( ) => DeliveryMode != default ;
125128 public bool IsPriorityPresent ( ) => Priority != default ;
129+ [ MemberNotNullWhen ( true , nameof ( CorrelationId ) ) ]
126130 public bool IsCorrelationIdPresent ( ) => CorrelationId != default ;
131+ [ MemberNotNullWhen ( true , nameof ( ReplyTo ) ) ]
127132 public bool IsReplyToPresent ( ) => ReplyTo != default ;
133+ [ MemberNotNullWhen ( true , nameof ( Expiration ) ) ]
128134 public bool IsExpirationPresent ( ) => Expiration != default ;
135+ [ MemberNotNullWhen ( true , nameof ( MessageId ) ) ]
129136 public bool IsMessageIdPresent ( ) => MessageId != default ;
130137 public bool IsTimestampPresent ( ) => Timestamp != default ;
138+ [ MemberNotNullWhen ( true , nameof ( Type ) ) ]
131139 public bool IsTypePresent ( ) => Type != default ;
140+ [ MemberNotNullWhen ( true , nameof ( UserId ) ) ]
132141 public bool IsUserIdPresent ( ) => UserId != default ;
142+ [ MemberNotNullWhen ( true , nameof ( AppId ) ) ]
133143 public bool IsAppIdPresent ( ) => AppId != default ;
144+ [ MemberNotNullWhen ( true , nameof ( ClusterId ) ) ]
134145 public bool IsClusterIdPresent ( ) => ClusterId != default ;
135146
136147 ushort IAmqpHeader . ProtocolClassId => ClassConstants . Basic ;
0 commit comments