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

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class SoftwareConfigurationImage
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string imageNameField;

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

	[XmlAttribute]
	public string ImageName
	{
		get
		{
			return imageNameField;
		}
		set
		{
			imageNameField = value;
		}
	}

	[XmlAttribute]
	public string Revision
	{
		get
		{
			return revisionField;
		}
		set
		{
			revisionField = value;
		}
	}

	public bool ShouldSerializeImageName()
	{
		return !string.IsNullOrEmpty(ImageName);
	}

	public bool ShouldSerializeRevision()
	{
		return !string.IsNullOrEmpty(Revision);
	}

	public SoftwareConfigurationImage()
	{
		imageNameField = string.Empty;
		revisionField = string.Empty;
	}

	public SoftwareConfigurationImage(string imageName = null, string revision = null)
	{
		if (!string.IsNullOrEmpty(imageName))
		{
			imageNameField = imageName;
		}
		else
		{
			imageNameField = string.Empty;
		}
		if (!string.IsNullOrEmpty(revision))
		{
			revisionField = revision;
		}
		else
		{
			revisionField = string.Empty;
		}
	}
}
