renamed VaultEventsMap.Key parameters for clarity

This commit is contained in:
Armin Schrenk
2025-03-18 17:57:15 +01:00
parent cc5c46743b
commit 5350e07f62
2 changed files with 5 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ public class VaultEventsMap extends ObservableMapDecorator<VaultEventsMap.Key, V
private static final int MAX_SIZE = 300;
public record Key(Vault v, Path key, Class<? extends FilesystemEvent> c) {}
public record Key(Vault vault, Path idPath, Class<? extends FilesystemEvent> c) {}
public record Value(FilesystemEvent mostRecentEvent, int count) {}
@@ -66,11 +66,11 @@ public class VaultEventsMap extends ObservableMapDecorator<VaultEventsMap.Key, V
if (timeComparsion != 0) {
return timeComparsion;
}
var vaultIdComparsion = left.v.getId().compareTo(right.v.getId());
var vaultIdComparsion = left.vault.getId().compareTo(right.vault.getId());
if (vaultIdComparsion != 0) {
return vaultIdComparsion;
}
var pathComparsion = left.key.compareTo(right.key);
var pathComparsion = left.idPath.compareTo(right.idPath);
if (pathComparsion != 0) {
return pathComparsion;
}
@@ -86,7 +86,7 @@ public class VaultEventsMap extends ObservableMapDecorator<VaultEventsMap.Key, V
public synchronized List<VaultEvent> listAll() {
return lruCache.stream().map(key -> {
var value = delegate.get(key);
return new VaultEvent(key.v(), value.mostRecentEvent(), value.count());
return new VaultEvent(key.vault(), value.mostRecentEvent(), value.count());
}).toList();
}

View File

@@ -71,7 +71,7 @@ public class EventViewController implements FxController {
}
private void updateList(MapChangeListener.Change<? extends VaultEventsMap.Key, ? extends VaultEventsMap.Value> change) {
var vault = change.getKey().v();
var vault = change.getKey().vault();
if (change.wasAdded() && change.wasRemoved()) {
//entry updated
eventList.remove(new VaultEvent(vault, change.getValueRemoved().mostRecentEvent(), change.getValueRemoved().count()));