using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper5.Docsis
{
    [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
    public sealed class MacManagementMessageTypeAttribute : Attribute
    {
        public byte Version { get; }
        public byte Type { get; }

        public MacManagementMessageTypeAttribute(byte version, byte type)
        {
            Version = version;
            Type = type;
        }

        private bool Equals(MacManagementMessageTypeAttribute other)
        {
            return base.Equals(other) && Version == other.Version && Type == other.Type;
        }

        public override bool Equals(object obj)
        {
            return ReferenceEquals(this, obj) || obj is MacManagementMessageTypeAttribute other && Equals(other);
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(base.GetHashCode(), Version, Type);
        }

        public override string ToString()
        {
            return $"{nameof(Version)}: {Version}, {nameof(Type)}: {Type}";
        }
    }
}
