Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8676ca9f719c84697e679968452383238e96bcfa (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*******************************************************************************
 * Copyright (c) 2014 QNX Software Systems 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:
 * Elena Laskavaia - Initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.launchbar.core;

/**
 * Convenience implementation of ILaunchDescriptor
 * 
 * @author elaskavaia
 *
 */
public abstract class AbstractLaunchDescriptor implements ILaunchDescriptor {

	@Override
	public abstract String getName();

	@Override
	public abstract ILaunchDescriptorType getType();

	public String getId() {
		return getName() + "." + getType().getId();
	}

	@Override
	public int hashCode() {
		return 17 + getId().hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof AbstractLaunchDescriptor))
			return false;
		AbstractLaunchDescriptor other = (AbstractLaunchDescriptor) obj;
		if (!getId().equals(other.getId()))
			return false;
		return true;
	}
}

Back to the top