protected void updatePositions() { AtomicInteger position = new AtomicInteger(1); sortedColumns.replaceAll((name, defn) -> { // Decrement the position ... int nextPosition = position.getAndIncrement(); if (defn.position() != nextPosition) { return defn.edit().position(nextPosition).create(); } return defn; }); }
@Override public synchronized void replaceAll(BiFunction<? super Object, ? super Object, ?> function) { propertyMap.replaceAll(function); }
protected void updatePositions() { AtomicInteger position = new AtomicInteger(1); sortedColumns.replaceAll((name, defn) -> { // Decrement the position ... int nextPosition = position.getAndIncrement(); if (defn.position() != nextPosition) { return defn.edit().position(nextPosition).create(); } return defn; }); }