Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (GetType() != obj.GetType())
            {
                return(false);
            }
            StringMatcher <TKey> other = (StringMatcher <TKey>)obj;

            if (CompareToValue == null)
            {
                if (other.CompareToValue != null)
                {
                    return(false);
                }
            }
            else if (!CompareToValue.Equals(other.CompareToValue))
            {
                return(false);
            }
            if (!CompareWithOperator.Equals(other.CompareWithOperator))
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public override int GetHashCode()
        {
            const int Prime  = 31;
            int       result = 1;

            result = Prime * result + (CompareToValue?.GetHashCode() ?? 0);
            result = Prime * result + CompareWithOperator.GetHashCode();
            return(result);
        }
Esempio n. 3
0
 public bool IsMatch(TKey key)
 {
     return(CompareToValue.Equals(key));
 }