public final class IRCConfigBuilder extends Object
IRCConfigs. For the typical usage, see IRCConnection.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_AUTOPONG
Default
autoPong is |
static String |
DEFAULT_ENCODING
Default
encoding is |
static boolean |
DEFAULT_STRIP_COLORS
Default
stripColors is
|
static int |
DEFAULT_TIMEOUT
Default
timeout is
milliseconds which is 15 minutes |
| Modifier and Type | Method and Description |
|---|---|
IRCConfigBuilder |
autoPong(boolean autoPong)
Enables or disables the automatic PING? PONG! support.
|
IRCConfig |
build() |
IRCConfigBuilder |
config(IRCConfig config)
Copies all available fields from the given
config to this
IRCConfigBuilder. |
IRCConfigBuilder |
encoding(String encoding)
Changes the character encoding (such as
"UTF-8" or
"ISO-8859-1") used to talk to the server. |
IRCConfigBuilder |
exceptionHandler(IRCExceptionHandler exceptionHandler)
Sets the
IRCExceptionHandler that should be notified by
IRCConnection when an exception during send or receive of IRC
messages occurs. |
IRCConfigBuilder |
host(String host)
Sets the hostname or IP address of the IRC server to connect to.
|
static IRCConfigBuilder |
newBuilder()
Creates a new
IRCConfigBuilder initializing the following fields
with defaults:
autoPong(boolean)
encoding(String)
stripColors(boolean)
timeout(int)
Other fields are left null. |
IRCConfigBuilder |
nick(String nick)
Sets the nick name preferred by the user who is connecting.
|
IRCConfigBuilder |
password(String password)
Sets the password of the user who is connecting.
|
IRCConfigBuilder |
port(int port)
Adds the given
port to the internal list of ports. |
IRCConfigBuilder |
portRange(int portMin,
int portMax)
Adds the port numbers from the given range to the internal list of ports.
|
IRCConfigBuilder |
ports(int... port)
Adds the given port numbers to the internal list of ports.
|
IRCConfigBuilder |
realname(String realname)
Sets the real name (e.g.
|
IRCConfigBuilder |
runtimeConfig(IRCRuntimeConfig runtimeConfig)
Copies all available fields from the given
runtimeConfig to this
IRCConfigBuilder. |
IRCConfigBuilder |
serverConfig(IRCServerConfig serverConfig)
Copies all available fields from the given
serverConfig to this
IRCConfigBuilder. |
IRCConfigBuilder |
socksProxy(String socksProxyHost,
int socksProxyPort)
Instructs the connection to use a SOCKS proxy with given
host and
port. |
IRCConfigBuilder |
sslSupport(IRCSSLSupport sslSupport)
Sets the
IRCSSLSupport containing the information the
IRCConnection should use to connect using SSL. |
IRCConfigBuilder |
stripColors(boolean stripColors)
Enables or disables the stripping of mIRC color codes.
|
IRCConfigBuilder |
timeout(int millis)
Sets the preferred connection's timeout in milliseconds.
|
IRCConfigBuilder |
trafficLogger(IRCTrafficLogger trafficLogger)
Sets the
IRCTrafficLogger that should be notified by
IRCConnection about incoming and outgoing messages. |
IRCConfigBuilder |
username(String username)
Sets the username of the user connecting to the IRC server.
|
public static final boolean DEFAULT_AUTOPONG
autoPong is public static final String DEFAULT_ENCODING
encoding is public static final boolean DEFAULT_STRIP_COLORS
stripColors is
public static final int DEFAULT_TIMEOUT
timeout is
milliseconds which is 15 minutespublic static IRCConfigBuilder newBuilder()
IRCConfigBuilder initializing the following fields
with defaults:
Other fields are left null.IRCConfigBuilderpublic IRCConfigBuilder autoPong(boolean autoPong)
autoPong - true to enable automatic PONG reply,
false makes the class fire onPing
events.public IRCConfig build()
DefaultIRCConfig instance based on the values
stored in fields of this IRCConfigBuilder.public IRCConfigBuilder config(IRCConfig config)
config to this
IRCConfigBuilder.config - the IRCConfig to take the values frompublic IRCConfigBuilder encoding(String encoding)
"UTF-8" or
"ISO-8859-1") used to talk to the server. If not set through this
method, the default is "utf-8".encoding - The new encoding string, e.g. "UTF-8"public IRCConfigBuilder exceptionHandler(IRCExceptionHandler exceptionHandler)
IRCExceptionHandler that should be notified by
IRCConnection when an exception during send or receive of IRC
messages occurs.exceptionHandler - the IRCExceptionHandlerpublic IRCConfigBuilder host(String host)
host - the host name or IP addresspublic IRCConfigBuilder nick(String nick)
nick - the nick namepublic IRCConfigBuilder password(String password)
password - the passwordpublic IRCConfigBuilder port(int port)
port to the internal list of ports.port - the port or the host(String) to connect topublic IRCConfigBuilder portRange(int portMin, int portMax)
portMin is the first (lowest) port to add whereas portMax
is the last port to add.portMin - The beginning port of the port range.portMax - The ending port of the port range.public IRCConfigBuilder ports(int... port)
port - the port numbers to addpublic IRCConfigBuilder realname(String realname)
realname - the real namepublic IRCConfigBuilder runtimeConfig(IRCRuntimeConfig runtimeConfig)
runtimeConfig to this
IRCConfigBuilder.runtimeConfig - the IRCRuntimeConfig to take the values frompublic IRCConfigBuilder serverConfig(IRCServerConfig serverConfig)
serverConfig to this
IRCConfigBuilder.serverConfig - the IRCServerConfig to take the values frompublic IRCConfigBuilder socksProxy(String socksProxyHost, int socksProxyPort)
host and
port.socksProxyHost - the hostname or IP address of the SOCKS proxysocksProxyPort - the port of the SOCKS proxypublic IRCConfigBuilder sslSupport(IRCSSLSupport sslSupport)
IRCSSLSupport containing the information the
IRCConnection should use to connect using SSL.sslSupport - the username of the user connecting to the IRC serverpublic IRCConfigBuilder stripColors(boolean stripColors)
stripColors - true to enable, false to disable
colorspublic IRCConfigBuilder timeout(int millis)
millis - The socket's timeout in milliseconds.public IRCConfigBuilder trafficLogger(IRCTrafficLogger trafficLogger)
IRCTrafficLogger that should be notified by
IRCConnection about incoming and outgoing messages.trafficLogger - the IRCTrafficLogger the connection should notifypublic IRCConfigBuilder username(String username)
username - the username of the user connecting to the IRC serverCopyright © 2006–2015. All rights reserved.