import java.util.Collections;
import java.util.List;
+import net.pterodactylus.util.beans.Comparer;
+
/**
* A request is an ongoing download or upload reported by the freenet node.
*
public void setType(Type type) {
Type oldType = this.type;
this.type = type;
- if (((oldType == null) && (type != null)) || ((oldType != null) && (type == null)) || ((type != null) && !type.equals(oldType))) {
+ if (!Comparer.equal(oldType, type)) {
firePropertyChange(PROPERTY_TYPE, oldType, type);
}
}
public void setClientToken(String clientToken) {
String oldClientToken = this.clientToken;
this.clientToken = clientToken;
- if (((oldClientToken == null) && (clientToken != null)) || ((oldClientToken != null) && (clientToken == null)) || ((clientToken != null) && !clientToken.equals(oldClientToken))) {
+ if (!Comparer.equal(oldClientToken, clientToken)) {
firePropertyChange(PROPERTY_CLIENT_TOKEN, oldClientToken, clientToken);
}
}