/// <summary> /// Returns a <see cref="System.String"/> that represents this instance. /// </summary> /// <returns>A <see cref="System.String"/> that represents this instance.</returns> public override string ToString() { if (!Equals(Value, typeof(T).GetDefault())) { return(Value.ToString()); } if (GpraNonResponse != null) { return(GpraNonResponse.ToString()); } return("-"); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { int hash = 0; if (!Equals(Value, typeof(T).GetDefault())) { hash ^= Value.GetHashCode(); } else if (GpraNonResponse != null) { hash ^= GpraNonResponse.GetHashCode(); } return(hash); }
/// <summary> /// Initializes a new instance of the <see cref="GpraNonResponseType<T>"/> struct. /// </summary> /// <param name="gpraNonResponse">The gpra non response.</param> public GpraNonResponseType(GpraNonResponse gpraNonResponse) { Check.IsNotNull(gpraNonResponse, "GpraNonResponse cannot equal null."); _gpraNonResponse = gpraNonResponse; _value = (T)typeof(T).GetDefault(); }
/// <summary> /// Initializes a new instance of the <see cref="GpraNonResponseType<T>"/> struct. /// </summary> /// <param name="value">The value.</param> public GpraNonResponseType(T value) { Check.IsNotNull(value, "Value Cannot be Null."); _value = value; _gpraNonResponse = null; }