Convert AccountBadge to a record

This commit is contained in:
Jon Chambers
2024-10-16 12:45:00 -04:00
committed by Jon Chambers
parent c2270e57df
commit 865e3c5bde
6 changed files with 25 additions and 81 deletions

View File

@@ -37,7 +37,7 @@ public class ProfileHelper {
final List<AccountBadge> accountBadges) {
LinkedHashMap<String, AccountBadge> existingBadges = new LinkedHashMap<>(accountBadges.size());
for (final AccountBadge accountBadge : accountBadges) {
existingBadges.putIfAbsent(accountBadge.getId(), accountBadge);
existingBadges.putIfAbsent(accountBadge.id(), accountBadge);
}
LinkedHashMap<String, AccountBadge> result = new LinkedHashMap<>(accountBadges.size());
@@ -67,7 +67,7 @@ public class ProfileHelper {
for (final Map.Entry<String, AccountBadge> entry : existingBadges.entrySet()) {
if (!result.containsKey(entry.getKey())) {
AccountBadge accountBadge = entry.getValue().withVisibility(false);
result.put(accountBadge.getId(), accountBadge);
result.put(accountBadge.id(), accountBadge);
}
}