import java.util.Collections;
import java.util.List;
+import net.pterodactylus.util.beans.Comparer;
+
/**
* Container for a Freenet node. A Node is capable of notifying
* {@link PropertyChangeListener}s if any of the contained properties change.
public void setName(String name) {
String oldName = this.name;
this.name = name;
- if (((oldName != null) && (name == null)) || ((oldName == null) && (name != null)) || ((name != null) && !name.equals(oldName))) {
+ if (!Comparer.equal(oldName, name)) {
firePropertyChange(PROPERTY_NAME, oldName, name);
}
}
public void setHostname(String hostname) {
String oldHostname = this.hostname;
this.hostname = hostname;
- if (((oldHostname != null) && (hostname == null)) || ((oldHostname == null) && (hostname != null)) || ((hostname != null) && !hostname.equals(oldHostname))) {
+ if (!Comparer.equal(oldHostname, hostname)) {
firePropertyChange(PROPERTY_HOSTNAME, oldHostname, hostname);
}
}