19 package org.sleuthkit.autopsy.communications;
21 import com.google.common.collect.ImmutableSet;
22 import com.google.common.eventbus.EventBus;
23 import java.util.HashSet;
30 class PinnedAccountModel {
38 private final Set<AccountDeviceInstance> pinnedAccountDevices =
new HashSet<>();
40 private final EventBus eventBus =
new EventBus();
42 void registerhandler(Object handler) {
43 eventBus.register(handler);
46 void unregisterhandler(Object handler) {
47 eventBus.unregister(handler);
50 boolean isAccountPinned(AccountDeviceInstance account) {
51 return pinnedAccountDevices.contains(account);
61 void unpinAccount(Set<AccountDeviceInstance> accountDeviceInstances) {
62 pinnedAccountDevices.removeAll(accountDeviceInstances);
72 void pinAccount(Set<AccountDeviceInstance> accountDeviceInstances) {
73 pinnedAccountDevices.addAll(accountDeviceInstances);
83 return pinnedAccountDevices.isEmpty();
87 pinnedAccountDevices.clear();
90 ImmutableSet<AccountDeviceInstance> getPinnedAccounts() {
91 return ImmutableSet.copyOf(pinnedAccountDevices);