Decrease visibility of Http2FrameCodecBuilder default ctor to protected (#11220)

Motivation:

`Http2FrameCodecBuilder` defines static factory methods `forClient()`
and `forServer()` that should be used to create a new instance.
The default ctor is useful only when users need to override behavior
of the existing builder. Those users should define another way to create
an instance.

Modifications:

- Decrease visibility of `Http2FrameCodecBuilder` default ctor from
`public` to `protected`;
- Add javadoc to clarity responsibilities;

Result:

Users of `Http2FrameCodecBuilder` are not confused why
`new Http2FrameCodecBuilder().build()` works for the server-side, but
does not work for the client-side.
This commit is contained in:
Idel Pivnitskiy 2021-05-03 22:32:16 -07:00 committed by Norman Maurer
parent 15e459d593
commit d2643ed835

View File

@ -29,7 +29,16 @@ public class Http2FrameCodecBuilder extends
private Http2FrameWriter frameWriter; private Http2FrameWriter frameWriter;
public Http2FrameCodecBuilder() { /**
* Allows overriding behavior of existing builder.
* <p>
* Users of this constructor are responsible for invoking {@link #server(boolean)} method or overriding
* {@link #isServer()} method to give the builder information if the {@link Http2Connection}(s) it creates are in
* server or client mode.
*
* @see AbstractHttp2ConnectionHandlerBuilder
*/
protected Http2FrameCodecBuilder() {
} }
Http2FrameCodecBuilder(boolean server) { Http2FrameCodecBuilder(boolean server) {