Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
There is a lot of duplicate code in order to provide fluent style with methods. We could reduce the duplicate code with generics by adding an unbound type parameter T to TestDriver and then all the fluent methods could go in TestDriver but return type T. The base classes, MapDriverBase etc, would just pass the T on so you would have:
public abstract class TestDriver<K1, V1, K2, V2, T>
public abstract class MapDriverBase<K1, V1, K2, V2, T> extends TestDriver<K1, V1, K2, V2, T>
public class MapDriver<K1, V1, K2, V2> extends MapDriverBase<K1, V1, K2, V2, MapDriver<K1, V1, K2, V2>>