Package net.luckperms.api.metastacking
Interface DuplicateRemovalFunction
public interface DuplicateRemovalFunction
Functional interface which removes duplicate entries from a list.
Used by LuckPerms to remove duplicate entries from a MetaStack.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DuplicateRemovalFunction
ADuplicateRemovalFunction
that retains only the first occurrence.static final DuplicateRemovalFunction
ADuplicateRemovalFunction
that retains only the last occurrence.static final DuplicateRemovalFunction
ADuplicateRemovalFunction
that does not remove duplicates. -
Method Summary
Modifier and TypeMethodDescription<T> void
processDuplicates
(@NonNull List<T> list) Removes duplicates from the given list, according to the behaviour of the function.
-
Field Details
-
RETAIN_ALL
ADuplicateRemovalFunction
that does not remove duplicates. -
FIRST_ONLY
ADuplicateRemovalFunction
that retains only the first occurrence. -
LAST_ONLY
ADuplicateRemovalFunction
that retains only the last occurrence.
-
-
Method Details
-
processDuplicates
Removes duplicates from the given list, according to the behaviour of the function.- Type Parameters:
T
- the type of entries- Parameters:
list
- the entries
-