/******************************************************************************* * Copyright (c) 2010-2014 SAP AG and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * SAP AG - initial API and implementation *******************************************************************************/ package org.eclipse.skalli.model.ext.linkgroups; import java.io.Serializable; import java.util.Collection; import org.eclipse.skalli.commons.Link; public class LinkGroup extends OrderableGroup<Link> implements Serializable { private static final long serialVersionUID = -3346783232437679492L; private String caption; public LinkGroup() { super(); this.caption = null; } public LinkGroup(String caption, Collection<Link> links) { super(links); this.caption = caption; } public String getCaption() { return caption; } public void setCaption(String caption) { this.caption = caption; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((caption == null) ? 0 : caption.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } LinkGroup other = (LinkGroup) obj; if (caption == null) { if (other.caption != null) { return false; } } else if (!caption.equals(other.caption)) { return false; } return true; } }