public class UniqueItemsDuplicatesDetector extends java.lang.Object implements DuplicateConfigDetector
LegacyModeDuplicatesDetector do).| Constructor and Description |
|---|
UniqueItemsDuplicatesDetector(java.lang.Class<?>... uniqueItems) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getDuplicateItem(java.util.List<java.lang.Object> registered,
java.lang.Object newItem)
Called every time when configured object (guicey bundle or guice module) of the same type is already registered.
|
public UniqueItemsDuplicatesDetector(java.lang.Class<?>... uniqueItems)
public java.lang.Object getDuplicateItem(java.util.List<java.lang.Object> registered,
java.lang.Object newItem)
DuplicateConfigDetectorFor example, if 3 or more instances of the same type are registered then method would be called for each new configured instance (in case of 3 registrations - 2 method calls, assuming that instances are not equal).
Provided instances will always be of the same class (no polymorphic checks). Classes loaded from different class loaders will be recognized as same class (and so provided instances may be instances of the same class but from different class loaders).
getDuplicateItem in interface DuplicateConfigDetectorregistered - already registered itemsnewItem - new item to check