@Override public int hashCode() { final int prime = 919; int hashCode = super.hashCode(); if (isSetVariable()) { hashCode += prime * getVariable().hashCode(); } if (isSetUnits()) { hashCode += prime * getUnits().hashCode(); } return hashCode; }
/** * Creates a new {@link ExplicitRule} * * @param rule */ public ExplicitRule(ExplicitRule rule) { super(rule); initDefaults(); if (rule.isSetVariable()) { setVariable(new String(rule.getVariable())); } if (rule.isSetUnits()) { setUnits(new String(rule.getUnits())); } }
@Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { ExplicitRule r = (ExplicitRule) object; equals &= isSetVariable() == r.isSetVariable(); if (equals && isSetVariable()) { equals &= getVariable().equals(r.getVariable()); } equals &= isSetUnits() == r.isSetUnits(); if (equals && isSetUnits()) { equals &= getUnits().equals(r.getUnits()); } } return equals; }
attributes.put(TreeNodeChangeEvent.units, getUnits());