#region License Information /* HeuristicLab * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core; namespace HeuristicLab.Clients.Hive.CloudManager.Model { public class AffinityGroup : Item { public string Name { get; set; } public string Label { get; set; } public string Description { get; set; } public string Location { get; set; } public AffinityGroup() { } public AffinityGroup(AffinityGroup original, Cloner cloner) { this.Name = original.Name; this.Label = original.Label; this.Description = original.Description; this.Location = original.Location; } public override bool Equals(object obj) { if (obj == null) return false; AffinityGroup ag = obj as AffinityGroup; if ((this.Name == ag.Name)) return true; else return false; } public override string ToString() { return string.Format("AffinityGroup: Name={0}, Label={1}, Location={2}", Name, Label, Location); } public override IDeepCloneable Clone(Cloner cloner) { return new AffinityGroup(this, cloner); } public void Merge(AffinityGroup affinityGroup) { if (!this.Equals(affinityGroup)) { throw new ArgumentException("Objects must be equal to be merged.", "subscription"); } this.Label = affinityGroup.Label; this.Description = affinityGroup.Description; this.Location = affinityGroup.Location; } } }