Migrate group weightings onto the group itself as well as to the chat meta held by it
This commit is contained in:
@@ -76,6 +76,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -403,6 +404,24 @@ public abstract class PermissionHolder {
|
||||
invalidateCache(true);
|
||||
}
|
||||
|
||||
public boolean removeIf(Predicate<Node> predicate) {
|
||||
boolean result;
|
||||
ImmutableSet<Node> before = ImmutableSet.copyOf(getNodes());
|
||||
|
||||
synchronized (nodes) {
|
||||
result = nodes.removeIf(predicate);
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
return false;
|
||||
}
|
||||
|
||||
invalidateCache(true);
|
||||
ImmutableSet<Node> after = ImmutableSet.copyOf(getNodes());
|
||||
plugin.getApiProvider().getEventFactory().handleNodeClear(this, before, after);
|
||||
return true;
|
||||
}
|
||||
|
||||
public Set<Node> getTransientNodes() {
|
||||
return transientCache.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user