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); }
public override int GetHashCode() { const int Prime = 31; int result = 1; result = Prime * result + (CompareToValue?.GetHashCode() ?? 0); result = Prime * result + CompareWithOperator.GetHashCode(); return(result); }
public bool IsMatch(TKey key) { return(CompareToValue.Equals(key)); }