コード例 #1
0
        public void MergeFrom(HttpStreamedTraceSegment other)
        {
            if (other == null)
            {
                return;
            }
            if (other.TraceId != 0UL)
            {
                TraceId = other.TraceId;
            }
            switch (other.MessagePieceCase)
            {
            case MessagePieceOneofCase.RequestHeaders:
                if (RequestHeaders == null)
                {
                    RequestHeaders = new global::Envoy.Api.V2.Core.HeaderMap();
                }
                RequestHeaders.MergeFrom(other.RequestHeaders);
                break;

            case MessagePieceOneofCase.RequestBodyChunk:
                if (RequestBodyChunk == null)
                {
                    RequestBodyChunk = new global::Envoy.Data.Tap.V2Alpha.Body();
                }
                RequestBodyChunk.MergeFrom(other.RequestBodyChunk);
                break;

            case MessagePieceOneofCase.RequestTrailers:
                if (RequestTrailers == null)
                {
                    RequestTrailers = new global::Envoy.Api.V2.Core.HeaderMap();
                }
                RequestTrailers.MergeFrom(other.RequestTrailers);
                break;

            case MessagePieceOneofCase.ResponseHeaders:
                if (ResponseHeaders == null)
                {
                    ResponseHeaders = new global::Envoy.Api.V2.Core.HeaderMap();
                }
                ResponseHeaders.MergeFrom(other.ResponseHeaders);
                break;

            case MessagePieceOneofCase.ResponseBodyChunk:
                if (ResponseBodyChunk == null)
                {
                    ResponseBodyChunk = new global::Envoy.Data.Tap.V2Alpha.Body();
                }
                ResponseBodyChunk.MergeFrom(other.ResponseBodyChunk);
                break;

            case MessagePieceOneofCase.ResponseTrailers:
                if (ResponseTrailers == null)
                {
                    ResponseTrailers = new global::Envoy.Api.V2.Core.HeaderMap();
                }
                ResponseTrailers.MergeFrom(other.ResponseTrailers);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }