using System;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class OutputItem : IEquatable<OutputItem>
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string nField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string vField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string minField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string sField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string maxField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string uField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string invalidField;

	[XmlAttribute("N")]
	public string Name
	{
		get
		{
			return nField;
		}
		set
		{
			nField = value;
		}
	}

	[XmlAttribute("V")]
	public string Value
	{
		get
		{
			return vField;
		}
		set
		{
			vField = value;
		}
	}

	[XmlAttribute("U")]
	public string Unit
	{
		get
		{
			return uField;
		}
		set
		{
			uField = value;
		}
	}

	[XmlAttribute("Min")]
	public string Minimum
	{
		get
		{
			return minField;
		}
		set
		{
			minField = value;
		}
	}

	[XmlAttribute("Max")]
	public string Maximum
	{
		get
		{
			return maxField;
		}
		set
		{
			maxField = value;
		}
	}

	[XmlAttribute("S")]
	public string Status
	{
		get
		{
			return sField;
		}
		set
		{
			sField = value;
		}
	}

	[XmlAttribute]
	public string Invalid
	{
		get
		{
			return invalidField;
		}
		set
		{
			invalidField = value;
		}
	}

	[XmlAttribute("RE")]
	public string ReportingEnabled { get; set; }

	public bool ShouldSerializeName()
	{
		return !string.IsNullOrEmpty(Name);
	}

	public bool ShouldSerializeValue()
	{
		return !string.IsNullOrEmpty(Value);
	}

	public bool ShouldSerializeUnit()
	{
		return !string.IsNullOrEmpty(Unit);
	}

	public bool ShouldSerializeMinimum()
	{
		return !string.IsNullOrEmpty(Minimum);
	}

	public bool ShouldSerializeMaximum()
	{
		return !string.IsNullOrEmpty(Maximum);
	}

	public bool ShouldSerializeStatus()
	{
		return !string.IsNullOrEmpty(Status);
	}

	public bool ShouldSerializeInvalid()
	{
		return Invalid != null;
	}

	public OutputItem()
	{
		nField = string.Empty;
		vField = string.Empty;
		minField = string.Empty;
		sField = string.Empty;
		maxField = string.Empty;
		uField = string.Empty;
		invalidField = string.Empty;
	}

	public OutputItem(string n = null, string v = null, string min = null, string s = null, string max = null, string u = null, string invalid = null)
	{
		if (!string.IsNullOrEmpty(n))
		{
			nField = n;
		}
		else
		{
			nField = string.Empty;
		}
		if (!string.IsNullOrEmpty(v))
		{
			vField = v;
		}
		else
		{
			vField = string.Empty;
		}
		if (!string.IsNullOrEmpty(min))
		{
			minField = min;
		}
		else
		{
			minField = string.Empty;
		}
		if (!string.IsNullOrEmpty(s))
		{
			sField = s;
		}
		else
		{
			sField = string.Empty;
		}
		if (!string.IsNullOrEmpty(max))
		{
			maxField = max;
		}
		else
		{
			maxField = string.Empty;
		}
		if (!string.IsNullOrEmpty(u))
		{
			uField = u;
		}
		else
		{
			uField = string.Empty;
		}
		if (!string.IsNullOrEmpty(invalid))
		{
			invalidField = invalid;
		}
		else
		{
			invalidField = string.Empty;
		}
	}

	public bool Equals(OutputItem other)
	{
		if (Name.Equals(other.Name) && Value.Equals(other.Value) && Unit.Equals(other.Unit) && Minimum.Equals(other.Minimum) && Maximum.Equals(other.Maximum) && Status.Equals(other.Status) && Invalid.Equals(other.Invalid))
		{
			return ReportingEnabled.Equals(other.ReportingEnabled);
		}
		return false;
	}
}
