using System;

namespace skyscraper5.Skyscraper.Scraper.Storage.Utilities
{
	public class DatabaseKeyAprsWeatherReport
	{
		public string Sender { get; }
		public DateTime Timestamp { get; }

		public DatabaseKeyAprsWeatherReport(string sender, DateTime timestamp)
		{
			Sender = sender;
			Timestamp = timestamp;
		}

		protected bool Equals(DatabaseKeyAprsWeatherReport other)
		{
			return Sender == other.Sender && Timestamp.Equals(other.Timestamp);
		}

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(null, obj)) return false;
			if (ReferenceEquals(this, obj)) return true;
			if (obj.GetType() != this.GetType()) return false;
			return Equals((DatabaseKeyAprsWeatherReport)obj);
		}

		public override int GetHashCode()
		{
			return HashCode.Combine(Sender, Timestamp);
		}
	}
}
