/// <summary>Indicates whether this instance and a specified object are equal.</summary>
        /// <param name="obj">The object to compare with the current instance.</param>
        /// <returns>
        ///   true if <paramref name="obj" /> and this instance are the same type and represent the same value; otherwise, false.
        /// </returns>
        public override bool Equals(object obj)
        {
            if (obj is AlternateDataStreamInfo)
            {
                AlternateDataStreamInfo other = (AlternateDataStreamInfo)obj;
                return(StreamName.Equals(other.StreamName, StringComparison.OrdinalIgnoreCase) && Size.Equals(other.Size));
            }

            return(false);
        }
        /// <summary>Indicates whether this instance and a specified object are equal.</summary>
        /// <param name="obj">The object to compare with the current instance.</param>
        /// <returns>
        ///   true if <paramref name="obj" /> and this instance are the same type and represent the same value; otherwise, false.
        /// </returns>
        public override bool Equals(object obj)
        {
            if (obj is AlternateDataStreamInfo)
            {
                AlternateDataStreamInfo other = (AlternateDataStreamInfo)obj;
                return(StreamName.Equals(other.StreamName) && Size.Equals(other.Size));
            }

            return(false);
        }
 public void test1()
 {
     StreamName s1 = new StreamName(3, OrcProto.Stream.Types.Kind.DATA);
     StreamName s2 = new StreamName(3,
         OrcProto.Stream.Types.Kind.DICTIONARY_DATA);
     StreamName s3 = new StreamName(5, OrcProto.Stream.Types.Kind.DATA);
     StreamName s4 = new StreamName(5,
         OrcProto.Stream.Types.Kind.DICTIONARY_DATA);
     StreamName s1p = new StreamName(3, OrcProto.Stream.Types.Kind.DATA);
     Assert.Equal(true, s1.Equals(s1));
     Assert.Equal(false, s1.Equals(s2));
     Assert.Equal(false, s1.Equals(s3));
     Assert.Equal(true, s1.Equals(s1p));
     Assert.Equal(true, s1.CompareTo(null) < 0);
     Assert.Equal(false, s1.Equals(null));
     Assert.Equal(true, s1.CompareTo(s2) < 0);
     Assert.Equal(true, s2.CompareTo(s3) < 0);
     Assert.Equal(true, s3.CompareTo(s4) < 0);
     Assert.Equal(true, s4.CompareTo(s1p) > 0);
     Assert.Equal(0, s1p.CompareTo(s1));
 }
        public void test1()
        {
            StreamName s1 = new StreamName(3, OrcProto.Stream.Types.Kind.DATA);
            StreamName s2 = new StreamName(3,
                                           OrcProto.Stream.Types.Kind.DICTIONARY_DATA);
            StreamName s3 = new StreamName(5, OrcProto.Stream.Types.Kind.DATA);
            StreamName s4 = new StreamName(5,
                                           OrcProto.Stream.Types.Kind.DICTIONARY_DATA);
            StreamName s1p = new StreamName(3, OrcProto.Stream.Types.Kind.DATA);

            Assert.Equal(true, s1.Equals(s1));
            Assert.Equal(false, s1.Equals(s2));
            Assert.Equal(false, s1.Equals(s3));
            Assert.Equal(true, s1.Equals(s1p));
            Assert.Equal(true, s1.CompareTo(null) < 0);
            Assert.Equal(false, s1.Equals(null));
            Assert.Equal(true, s1.CompareTo(s2) < 0);
            Assert.Equal(true, s2.CompareTo(s3) < 0);
            Assert.Equal(true, s3.CompareTo(s4) < 0);
            Assert.Equal(true, s4.CompareTo(s1p) > 0);
            Assert.Equal(0, s1p.CompareTo(s1));
        }
Example #5
0
        public override bool Equals(object?other)
        {
            if (other == null || other.GetType() != typeof(EntryValue))
            {
                return(false);
            }

            var otherEntryValue = (EntryValue)other;

            return(StreamName.Equals(otherEntryValue.StreamName) &&
                   StreamVersion == otherEntryValue.StreamVersion &&
                   Type.Equals(otherEntryValue.Type) &&
                   Body.Equals(otherEntryValue.Body) &&
                   Snapshot.Equals(otherEntryValue.Snapshot));
        }
        public override bool EqualsNode(ExprNode node)
        {
            var other = node as ExprStreamUnderlyingNodeImpl;

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

            if (_isWildcard != other._isWildcard)
            {
                return(false);
            }
            return(_isWildcard || StreamName.Equals(other.StreamName));
        }
        public override bool EqualsNode(
            ExprNode node,
            bool ignoreStreamPrefix)
        {
            if (!(node is ExprStreamUnderlyingNodeImpl)) {
                return false;
            }

            var other = (ExprStreamUnderlyingNodeImpl) node;
            if (isWildcard != other.isWildcard) {
                return false;
            }

            if (isWildcard) {
                return true;
            }

            return StreamName.Equals(other.StreamName);
        }