예제 #1
0
        public override bool Equals(object obj)
        {
            StatPersistedV1 peer = (StatPersistedV1)obj;

            if (peer == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(peer, this))
            {
                return(true);
            }
            bool ret = false;

            ret = (Czxid == peer.Czxid);
            if (!ret)
            {
                return(ret);
            }
            ret = (Mzxid == peer.Mzxid);
            if (!ret)
            {
                return(ret);
            }
            ret = (Ctime == peer.Ctime);
            if (!ret)
            {
                return(ret);
            }
            ret = (Mtime == peer.Mtime);
            if (!ret)
            {
                return(ret);
            }
            ret = (Version == peer.Version);
            if (!ret)
            {
                return(ret);
            }
            ret = (Cversion == peer.Cversion);
            if (!ret)
            {
                return(ret);
            }
            ret = (Aversion == peer.Aversion);
            if (!ret)
            {
                return(ret);
            }
            ret = (EphemeralOwner == peer.EphemeralOwner);
            if (!ret)
            {
                return(ret);
            }
            return(ret);
        }
예제 #2
0
        public int CompareTo(object obj)
        {
            StatPersistedV1 peer = (StatPersistedV1)obj;

            if (peer == null)
            {
                throw new InvalidOperationException("Comparing different types of records.");
            }
            int ret = 0;

            ret = (Czxid == peer.Czxid)? 0 :((Czxid < peer.Czxid)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Mzxid == peer.Mzxid)? 0 :((Mzxid < peer.Mzxid)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Ctime == peer.Ctime)? 0 :((Ctime < peer.Ctime)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Mtime == peer.Mtime)? 0 :((Mtime < peer.Mtime)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Version == peer.Version)? 0 :((Version < peer.Version)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Cversion == peer.Cversion)? 0 :((Cversion < peer.Cversion)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Aversion == peer.Aversion)? 0 :((Aversion < peer.Aversion)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (EphemeralOwner == peer.EphemeralOwner)? 0 :((EphemeralOwner < peer.EphemeralOwner)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            return(ret);
        }