Class TcpConnection.Builder<B extends TcpConnection.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
TcpWrapperConnection.Builder
Enclosing class:
TcpConnection

public static class TcpConnection.Builder<B extends TcpConnection.Builder<B>> extends SocketConnection.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
2.22
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public TcpConnection build()
      Finish building the TcpConnection object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to TcpConnection.
      Overrides:
      build in class SocketConnection.Builder<B extends TcpConnection.Builder<B>>
      Returns:
      a new instance of TcpConnection with the properties that were set in the Builder object.
    • setGracefulDisconnect

      public B setGracefulDisconnect(boolean gracefulDisconnect)
      Whether IOStream.close(Cancellable) does a graceful disconnect.
      Parameters:
      gracefulDisconnect - the value for the graceful-disconnect property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.22