/*
- * Sone - IdentityChangeDetector.java - Copyright © 2013 David Roden
+ * Sone - IdentityChangeDetector.java - Copyright © 2013–2019 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* added and removed identities, and for identities that exist in both list
* their contexts and properties are checked for added, removed, or (in case of
* properties) changed values.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class IdentityChangeDetector {
return new Predicate<Identity>() {
@Override
public boolean apply(Identity identity) {
- return (identity == null) ? false : identityHasChanged(oldIdentities.get(identity.getId()), identity);
+ return (identity != null) && identityHasChanged(oldIdentities.get(identity.getId()), identity);
}
};
}
return new Predicate<String>() {
@Override
public boolean apply(String context) {
- return (identity == null) ? false : !identity.getContexts().contains(context);
+ return (identity != null) && !identity.getContexts().contains(context);
}
};
}
return new Predicate<Identity>() {
@Override
public boolean apply(Identity identity) {
- return (identity == null) ? false : !newIdentities.contains(identity);
+ return (identity != null) && !newIdentities.contains(identity);
}
};
}
return new Predicate<Entry<String, String>>() {
@Override
public boolean apply(Entry<String, String> property) {
- return (property == null) ? false : !identity.getProperties().containsKey(property.getKey());
+ return (property != null) && !identity.getProperties().containsKey(property.getKey());
}
};
}
return new Predicate<Entry<String, String>>() {
@Override
public boolean apply(Entry<String, String> property) {
- return (property == null) ? false : !newIdentity.getProperty(property.getKey()).equals(property.getValue());
+ return (property != null) && !newIdentity.getProperty(property.getKey()).equals(property.getValue());
}
};
}