コード例 #1
0
        public void MergeFrom(ValueMatcher other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.MatchPatternCase)
            {
            case MatchPatternOneofCase.NullMatch:
                if (NullMatch == null)
                {
                    NullMatch = new global::Envoy.Type.Matcher.ValueMatcher.Types.NullMatch();
                }
                NullMatch.MergeFrom(other.NullMatch);
                break;

            case MatchPatternOneofCase.DoubleMatch:
                if (DoubleMatch == null)
                {
                    DoubleMatch = new global::Envoy.Type.Matcher.DoubleMatcher();
                }
                DoubleMatch.MergeFrom(other.DoubleMatch);
                break;

            case MatchPatternOneofCase.StringMatch:
                if (StringMatch == null)
                {
                    StringMatch = new global::Envoy.Type.Matcher.StringMatcher();
                }
                StringMatch.MergeFrom(other.StringMatch);
                break;

            case MatchPatternOneofCase.BoolMatch:
                BoolMatch = other.BoolMatch;
                break;

            case MatchPatternOneofCase.PresentMatch:
                PresentMatch = other.PresentMatch;
                break;

            case MatchPatternOneofCase.ListMatch:
                if (ListMatch == null)
                {
                    ListMatch = new global::Envoy.Type.Matcher.ListMatcher();
                }
                ListMatch.MergeFrom(other.ListMatch);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
コード例 #2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    global::Envoy.Type.Matcher.ValueMatcher.Types.NullMatch subBuilder = new global::Envoy.Type.Matcher.ValueMatcher.Types.NullMatch();
                    if (matchPatternCase_ == MatchPatternOneofCase.NullMatch)
                    {
                        subBuilder.MergeFrom(NullMatch);
                    }
                    input.ReadMessage(subBuilder);
                    NullMatch = subBuilder;
                    break;
                }

                case 18: {
                    global::Envoy.Type.Matcher.DoubleMatcher subBuilder = new global::Envoy.Type.Matcher.DoubleMatcher();
                    if (matchPatternCase_ == MatchPatternOneofCase.DoubleMatch)
                    {
                        subBuilder.MergeFrom(DoubleMatch);
                    }
                    input.ReadMessage(subBuilder);
                    DoubleMatch = subBuilder;
                    break;
                }

                case 26: {
                    global::Envoy.Type.Matcher.StringMatcher subBuilder = new global::Envoy.Type.Matcher.StringMatcher();
                    if (matchPatternCase_ == MatchPatternOneofCase.StringMatch)
                    {
                        subBuilder.MergeFrom(StringMatch);
                    }
                    input.ReadMessage(subBuilder);
                    StringMatch = subBuilder;
                    break;
                }

                case 32: {
                    BoolMatch = input.ReadBool();
                    break;
                }

                case 40: {
                    PresentMatch = input.ReadBool();
                    break;
                }

                case 50: {
                    global::Envoy.Type.Matcher.ListMatcher subBuilder = new global::Envoy.Type.Matcher.ListMatcher();
                    if (matchPatternCase_ == MatchPatternOneofCase.ListMatch)
                    {
                        subBuilder.MergeFrom(ListMatch);
                    }
                    input.ReadMessage(subBuilder);
                    ListMatch = subBuilder;
                    break;
                }
                }
            }
        }