01: /*******************************************************************************
02: * Copyright (c) 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.core;
11:
12: import org.eclipse.jdt.core.IClasspathAttribute;
13: import org.eclipse.jdt.internal.core.util.Util;
14:
15: public class ClasspathAttribute implements IClasspathAttribute {
16:
17: private String name;
18: private String value;
19:
20: public ClasspathAttribute(String name, String value) {
21: this .name = name;
22: this .value = value;
23: }
24:
25: public boolean equals(Object obj) {
26: if (!(obj instanceof ClasspathAttribute))
27: return false;
28: ClasspathAttribute other = (ClasspathAttribute) obj;
29: return this .name.equals(other.name)
30: && this .value.equals(other.value);
31: }
32:
33: public String getName() {
34: return this .name;
35: }
36:
37: public String getValue() {
38: return this .value;
39: }
40:
41: public int hashCode() {
42: return Util.combineHashCodes(this .name.hashCode(), this .value
43: .hashCode());
44: }
45:
46: public String toString() {
47: return this .name + "=" + this .value; //$NON-NLS-1$
48: }
49:
50: }
|