Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
1.8.0
-
None
-
None
Description
The currently generated code contains these two methods for the Builder instances (code sample was simplified):
public Request.Builder setConnection(NetworkConnection value) public Request.Builder setConnectionBuilder(NetworkConnection.Builder value)
My proposal: Add in addition the method:
public Request.Builder setConnection(NetworkConnection.Builder value)
Advantage:
- You can do .setConnection(something) and pass either a NetworkConnection or a NetworkConnection.Builder.
- User code becomes a bit more readable.
Disadvantages:
- Explicitly setting a null will trigger a "Multiple implementations" error and as such will need an explicit typecast.
- This may be considered breaking backward compatibility!
To solve this you must do either this:.setConnection((NetworkConnection)null)
or this
NetworkConnection nc = null; ... .setConnection(nc)
- This may be considered breaking backward compatibility!