Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
There are some problems and ambiguities with API for adding ordered dependencies:
- you can call after() / before() without adding anything first, that will cause NPE
- right order of calls is not clear: add().after() or after().add()
Suggested API modification:
- remove UnorderedListBuilder, keep everything in ListBuilder
- add methods with explicit before\after parameters:
ListBuilder<T> addAfter(Class<? extends T> interfaceType, Class<? extends T> afterType); ListBuilder<T> addAfter(T value, Class<? extends T> afterType); ListBuilder<T> addAllAfter(Collection<T> values, Class<? extends T> afterType); ListBuilder<T> insertBefore(Class<? extends T> interfaceType, Class<? extends T> beforeType); ListBuilder<T> insertBefore(T value, Class<? extends T> beforeType); ListBuilder<T> insertAllBefore(Collection<T> values, Class<? extends T> beforeType);