Пример #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (startKeyTypeCase_ == StartKeyTypeOneofCase.StartClosed)
            {
                hash ^= StartClosed.GetHashCode();
            }
            if (startKeyTypeCase_ == StartKeyTypeOneofCase.StartOpen)
            {
                hash ^= StartOpen.GetHashCode();
            }
            if (endKeyTypeCase_ == EndKeyTypeOneofCase.EndClosed)
            {
                hash ^= EndClosed.GetHashCode();
            }
            if (endKeyTypeCase_ == EndKeyTypeOneofCase.EndOpen)
            {
                hash ^= EndOpen.GetHashCode();
            }
            hash ^= (int)startKeyTypeCase_;
            hash ^= (int)endKeyTypeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #2
0
        public void MergeFrom(KeyRange other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.StartKeyTypeCase)
            {
            case StartKeyTypeOneofCase.StartClosed:
                if (StartClosed == null)
                {
                    StartClosed = new global::Google.Protobuf.WellKnownTypes.ListValue();
                }
                StartClosed.MergeFrom(other.StartClosed);
                break;

            case StartKeyTypeOneofCase.StartOpen:
                if (StartOpen == null)
                {
                    StartOpen = new global::Google.Protobuf.WellKnownTypes.ListValue();
                }
                StartOpen.MergeFrom(other.StartOpen);
                break;
            }

            switch (other.EndKeyTypeCase)
            {
            case EndKeyTypeOneofCase.EndClosed:
                if (EndClosed == null)
                {
                    EndClosed = new global::Google.Protobuf.WellKnownTypes.ListValue();
                }
                EndClosed.MergeFrom(other.EndClosed);
                break;

            case EndKeyTypeOneofCase.EndOpen:
                if (EndOpen == null)
                {
                    EndOpen = new global::Google.Protobuf.WellKnownTypes.ListValue();
                }
                EndOpen.MergeFrom(other.EndOpen);
                break;
            }

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