Commit 823cc817 authored by Nico Mack's avatar Nico Mack

Minor change in toString method

parent 3855323c
......@@ -25,6 +25,7 @@ import lu.list.itis.dkd.dbc.annotation.Nullable;
import lu.list.itis.dkd.tui.cps.InputChangeListener;
import lu.list.itis.dkd.tui.cps.InputEvent;
import lu.list.itis.dkd.tui.cps.utility.ExecutorScope;
import lu.list.itis.dkd.tui.utility.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -73,6 +74,8 @@ public abstract class Variable<V> implements Cloneable {
private static final Logger LOGGER = LoggerFactory.getLogger(Variable.class.getSimpleName());
private static final String VARIABLE_TEMPLATE = "{} = {} [{}]"; //$NON-NLS-1$
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Constructor(s) *
......@@ -247,7 +250,8 @@ public abstract class Variable<V> implements Cloneable {
/** {@inheritDoc} */
@Override
public String toString() {
return name + " (" + unit + ")"; //$NON-NLS-1$ //$NON-NLS-2$
// return name + " (" + unit + ")"; //$NON-NLS-1$ //$NON-NLS-2$
return StringUtils.build(VARIABLE_TEMPLATE, name, value, unit);
}
/** {@inheritDoc} */
......@@ -272,7 +276,7 @@ public abstract class Variable<V> implements Cloneable {
if (type.equals(variable.getType()) &&
name.equals(variable.getName()) &&
unit.equals(variable.getUnit())) {
return true;
return (value != null) && (value.equals(variable.value));
}
}
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment