Package org.gnome.gio
Class Socket.Builder<B extends Socket.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gio.Socket.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Socket
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSocket
object.setBlocking
(boolean blocking) Whether I/O on this socket is blocking.setBroadcast
(boolean broadcast) Whether the socket should allow sending to broadcast addresses.setFamily
(SocketFamily family) The socket’s address family.setFd
(int fd) The socket’s file descriptor.setKeepalive
(boolean keepalive) Whether to keep the connection alive by sending periodic pings.setListenBacklog
(int listenBacklog) The number of outstanding connections in the listen queue.setMulticastLoopback
(boolean multicastLoopback) Whether outgoing multicast packets loop back to the local host.setMulticastTtl
(int multicastTtl) Time-to-live out outgoing multicast packetssetProtocol
(SocketProtocol protocol) The ID of the protocol to use, or-1
for unknown.setTimeout
(int timeout) The timeout in seconds on socket I/OsetTtl
(int ttl) Time-to-live for outgoing unicast packetssetType
(SocketType type) The socket’s type.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theSocket
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toSocket
.- Overrides:
build
in classGObject.Builder<B extends Socket.Builder<B>>
- Returns:
- a new instance of
Socket
with the properties that were set in the Builder object.
-
setBlocking
Whether I/O on this socket is blocking.- Parameters:
blocking
- the value for theblocking
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setBroadcast
Whether the socket should allow sending to broadcast addresses.- Parameters:
broadcast
- the value for thebroadcast
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setFamily
The socket’s address family.- Parameters:
family
- the value for thefamily
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setFd
The socket’s file descriptor.- Parameters:
fd
- the value for thefd
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setKeepalive
Whether to keep the connection alive by sending periodic pings.- Parameters:
keepalive
- the value for thekeepalive
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setListenBacklog
The number of outstanding connections in the listen queue.- Parameters:
listenBacklog
- the value for thelisten-backlog
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMulticastLoopback
Whether outgoing multicast packets loop back to the local host.- Parameters:
multicastLoopback
- the value for themulticast-loopback
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMulticastTtl
Time-to-live out outgoing multicast packets- Parameters:
multicastTtl
- the value for themulticast-ttl
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setProtocol
The ID of the protocol to use, or-1
for unknown.- Parameters:
protocol
- the value for theprotocol
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTimeout
The timeout in seconds on socket I/O- Parameters:
timeout
- the value for thetimeout
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTtl
Time-to-live for outgoing unicast packets- Parameters:
ttl
- the value for thettl
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setType
The socket’s type.- Parameters:
type
- the value for thetype
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-