blob: 7b25daf4543ecf1d359616d8ae337cecb0e48c05 [file] [log] [blame]
/**
* Copyright (c) 2008 - 2010 OptXware Research and Development LLC.
* 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:
* Daniel Varro - Initial API and implementation
*/
package org.eclipse.viatra2.lpgparser.typechecker;
public class StringPair {
protected String name;
protected String firstArg;
public StringPair(String name, String firstArg) {
this.name = name;
this.firstArg = firstArg;
}
public String getName() {
return name;
}
public String getFirstArg() {
return firstArg;
}
@Override
public int hashCode() {
final int prime = 7919;
int result = 1;
result = prime * result
+ ((firstArg == null) ? 0 : firstArg.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (obj == null){
return false;
}
else if (this == obj) {
return true;
}
if (getClass() != obj.getClass())
return false;
if (obj instanceof StringPair) {
StringPair strTriple = (StringPair) obj;
if (strTriple.getName().equals(name) &&
strTriple.getFirstArg().equals(firstArg)) {
return true;
}
}
return false;
}
}