using System;
using System.Collections.Generic;

namespace QTMDataFormat;

public class SerialNumberInfoItem : IEquatable<SerialNumberInfoItem>
{
	public class SerialInfoComparer : IEqualityComparer<SerialNumberInfoItem>
	{
		public bool Equals(SerialNumberInfoItem x, SerialNumberInfoItem y)
		{
			if (x.UUT_SN == y.UUT_SN && x.Workstation == y.Workstation)
			{
				return x.VisitNum == y.VisitNum;
			}
			return false;
		}

		public int GetHashCode(SerialNumberInfoItem obj)
		{
			return obj.ToString().GetHashCode();
		}
	}

	private string uut_sn;

	private string workstation;

	private string visitNum;

	private Type serialInfoValueTypes;

	public string UUT_SN
	{
		get
		{
			return uut_sn;
		}
		set
		{
			uut_sn = value;
		}
	}

	public string Workstation
	{
		get
		{
			return workstation;
		}
		set
		{
			workstation = value;
		}
	}

	public string VisitNum
	{
		get
		{
			return visitNum;
		}
		set
		{
			visitNum = value;
		}
	}

	public Type SerialInfoValueType
	{
		get
		{
			return serialInfoValueTypes;
		}
		set
		{
			serialInfoValueTypes = value;
		}
	}

	public override string ToString()
	{
		return UUT_SN + "_" + Workstation + "_" + VisitNum;
	}

	public bool Equals(SerialNumberInfoItem other)
	{
		if (other != null && other.UUT_SN == UUT_SN && other.Workstation == Workstation)
		{
			return other.VisitNum == VisitNum;
		}
		return false;
	}
}
