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
FieldsModifier and TypeFieldDescriptionstatic final DuplicateRemovalFunctionADuplicateRemovalFunctionthat retains only the first occurrence.static final DuplicateRemovalFunctionADuplicateRemovalFunctionthat retains only the last occurrence.static final DuplicateRemovalFunctionADuplicateRemovalFunctionthat does not remove duplicates. -
Method Summary
Modifier and TypeMethodDescription<T> voidprocessDuplicates(@NonNull List<T> list) Removes duplicates from the given list, according to the behaviour of the function.
-
Field Details
-
RETAIN_ALL
ADuplicateRemovalFunctionthat does not remove duplicates. -
FIRST_ONLY
ADuplicateRemovalFunctionthat retains only the first occurrence. -
LAST_ONLY
ADuplicateRemovalFunctionthat 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
-