SchedulerEndpoint.cs 906 Bytes
Newer Older
Vaclav Svaton's avatar
Vaclav Svaton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
using HaaSMiddleware.DomainObjects.ClusterInformation;

namespace HaaSMiddleware.HpcConnectionFramework {
	internal struct SchedulerEndpoint {
		public SchedulerEndpoint(string masterNodeName, SchedulerType schedulerType) : this() {
			this.MasterNodeName = masterNodeName;

			this.SchedulerType = schedulerType;
		}

		public string MasterNodeName { get; private set; }

		public SchedulerType SchedulerType { get; private set; }

		public override bool Equals(object obj) {
			return (obj is SchedulerEndpoint) &&
			       (this.MasterNodeName.Equals(((SchedulerEndpoint) obj).MasterNodeName)) &&
			       (this.SchedulerType.Equals(((SchedulerEndpoint) obj).SchedulerType));
		}

		public override int GetHashCode() {
			unchecked {
				var hash = 17;
				hash = (23*hash) + this.MasterNodeName.GetHashCode();
				hash = (23*hash) + this.SchedulerType.GetHashCode();
				return hash;
			}
		}
	}
}