/*******************************************************************************
* Copyright (c) 2009, 2010 Innovation Gate GmbH.
* 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:
* Innovation Gate GmbH - initial API and implementation
******************************************************************************/
package de.innovationgate.eclipse.editors.tmlscript.parsing;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
public class TMLScriptMethodParameter {
private String _name;
private String _type;
private boolean _vararg = false;
public TMLScriptMethodParameter(String name, String type) {
_name = name;
_type = type;
}
public String getType() {
return _type;
}
public String getName() {
return _name;
}
@Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof TMLScriptMethodParameter) {
TMLScriptMethodParameter other = (TMLScriptMethodParameter) obj;
EqualsBuilder builder = new EqualsBuilder();
builder.append(hashCode(), other.hashCode());
return builder.isEquals();
}
return super.equals(obj);
}
@Override
public int hashCode() {
HashCodeBuilder builder = new HashCodeBuilder();
builder.append(getType());
return builder.toHashCode();
}
public void setVararg(boolean vararg) {
_vararg = vararg;
}
public boolean isVararg() {
return _vararg;
}
}