示例#1
0
文件: Message.cs 项目: winhu/Steeltoe
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (obj == null)
            {
                return(false);
            }

            if (GetType() != obj.GetType())
            {
                return(false);
            }

            var other = (Message)obj;

            if (!ObjectUtils.NullSafeEquals(Body, other.Body))
            {
                return(false);
            }

            if (MessageProperties == null)
            {
                if (other.MessageProperties != null)
                {
                    return(false);
                }
            }
            else if (!MessageProperties.Equals(other.MessageProperties))
            {
                return(false);
            }

            return(true);
        }
示例#2
0
 public void Copy(MessageProperties source)
 {
     AppId                 = source.AppId;
     ClusterId             = source.ClusterId;
     ConsumerQueue         = source.ConsumerQueue;
     ConsumerTag           = source.ConsumerTag;
     ContentEncoding       = source.ContentEncoding;
     ContentLength         = source.ContentLength;
     ContentType           = source.ContentType;
     CorrelationId         = source.CorrelationId;
     DeliveryMode          = source.DeliveryMode;
     DeliveryTag           = source.DeliveryTag;
     Expiration            = source.Expiration;
     InferredArgumentType  = source.InferredArgumentType;
     MessageCount          = source.MessageCount;
     Priority              = source.Priority;
     PublishSequenceNumber = source.PublishSequenceNumber;
     ReceivedDeliveryMode  = source.ReceivedDeliveryMode;
     ReceivedExchange      = source.ReceivedExchange;
     ReceivedRoutingKey    = source.ReceivedRoutingKey;
     ReceivedUserId        = source.ReceivedUserId;
     Redelivered           = source.Redelivered;
     ReplyTo               = source.ReplyTo;
     ReplyToAddress        = source.ReplyToAddress;
     Target                = source.Target;
     TargetMethod          = source.TargetMethod;
     Timestamp             = source.Timestamp;
     Type   = source.Type;
     UserId = source.UserId;
     FinalRetryForMessageWithNoId = source.FinalRetryForMessageWithNoId;
     LastInBatch = source.LastInBatch;
     foreach (var entry in source.Headers)
     {
         Headers[entry.Key] = entry.Value;
     }
 }
示例#3
0
 public MessageBuilder AndProperties(MessageProperties properties)
 {
     Properties = properties;
     return(this);
 }
示例#4
0
 private MessageBuilder(byte[] body, MessageProperties properties)
 {
     _body = body;
     CopyProperties(properties);
 }
示例#5
0
文件: Message.cs 项目: winhu/Steeltoe
 public Message(byte[] body, MessageProperties messageProperties)
 {
     Body = body;
     MessageProperties = messageProperties;
 }
示例#6
0
 protected AbstractMessageBuilder(MessageProperties properties)
 {
     Properties = properties;
 }