using System;

namespace Interfaces
{
    public class Identifier
    {
        public int Id { get; set; }
        public string UniqueId { get; set; }
        public bool IsAssociatedToUser { get; set; }
        public DateTime LastUsed { get; set; }
        public override bool Equals(object obj)
        {
            var identObj = obj as Identifier;
            if (identObj == null) return false;

            return identObj.Id == Id
                   && identObj.IsAssociatedToUser == IsAssociatedToUser
                   && identObj.UniqueId == UniqueId;
        }

        public override int GetHashCode()
        {
            return Id.GetHashCode() ^ UniqueId.GetHashCode() ^ IsAssociatedToUser.GetHashCode() ^ LastUsed.GetHashCode();
        }
    }
}