add equals to intstr

This commit is contained in:
Boshi Lian
2017-11-24 17:45:43 +08:00
parent f7c0aa34d3
commit a04e6d22ba

View File

@@ -52,5 +52,23 @@ namespace k8s.Models
{
return new IntstrIntOrString(v);
}
protected bool Equals(IntstrIntOrString other)
{
return string.Equals(Value, other.Value);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((IntstrIntOrString) obj);
}
public override int GetHashCode()
{
return (Value != null ? Value.GetHashCode() : 0);
}
}
}