/// <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 (DensAsiNonResponse != null) { return(DensAsiNonResponse.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 (DensAsiNonResponse != null) { hash ^= DensAsiNonResponse.GetHashCode(); } return(hash); }
/// <summary> /// Initializes a new instance of the <see cref="DensAsiNonResponseType<T>"/> struct. /// </summary> /// <param name="densAsiNonResponse">The dens asi non response.</param> public DensAsiNonResponseType(DensAsiNonResponse densAsiNonResponse) { Check.IsNotNull(densAsiNonResponse, "DensAsiNonResponse cannot equal null."); _densAsiNonResponse = densAsiNonResponse; _value = (T)typeof(T).GetDefault(); }
/// <summary> /// Initializes a new instance of the <see cref="DensAsiNonResponseType<T>"/> struct. /// </summary> /// <param name="value">The value.</param> public DensAsiNonResponseType(T value) { Check.IsNotNull(value, "Value cannot be null."); _value = value; _densAsiNonResponse = null; }