public abstract class AbstractDuplicateResolver extends Object implements DuplicateResolver
DuplicateResolver implementation that provides basic methods for duplicates detection based on Matcher.| Constructor and Description |
|---|
AbstractDuplicateResolver(Matcher matcher)
Constructs new
AbstractDuplicateResolver. |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
firstDuplicate(Collection collection)
Returns first
Collection duplicates if it has any, null if it has none. |
protected boolean |
hasDuplicates(Collection collection)
Returns whether or not specified
Collection has one or more duplicates. |
protected Collection |
removeDuplicates(Collection collection)
Removes any duplicates from the specified
Collection and returns it. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresolvepublic AbstractDuplicateResolver(@NotNull Matcher matcher)
AbstractDuplicateResolver.matcher - Matcher for duplicates detectionprotected boolean hasDuplicates(@NotNull Collection collection)
Collection has one or more duplicates.collection - Collection to check for duplicatestrue if specified Collection has one or more duplicates, false otherwise@Nullable protected Object firstDuplicate(@NotNull Collection collection)
Collection duplicates if it has any, null if it has none.collection - Collection to check for duplicatesCollection duplicates if it has any, null if it has none@NotNull protected Collection removeDuplicates(@NotNull Collection collection)
Collection and returns it.
todo This will always remove duplicates starting from second, while removing all but last can be more convenient at timescollection - Collection to remove duplicates fromCollection with all duplicates removed from itCopyright © 2020. All rights reserved.