public class DefaultServerInfo extends Object implements ServerInfo.WithManagement
ServerInfo.WithManagement
Constructor and Description |
---|
DefaultServerInfo(@NonNull Client client)
Constructs the server info.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomChannelMode(@NonNull ChannelMode mode)
Adds a custom channel mode, for a server that doesn't correctly list
modes.
|
void |
addCustomUserMode(@NonNull UserMode mode)
Adds a custom user mode, for a server that doesn't correctly list
modes.
|
void |
addISupportParameter(@NonNull ISupportParameter parameter)
Adds an ISUPPORT parameter to the list of supported parameters.
|
@NonNull Optional<String> |
getAddress()
Gets the server-stated address of the server.
|
@NonNull List<ChannelMode> |
getChannelModes()
Gets the channel modes available.
|
@NonNull List<Character> |
getChannelPrefixes()
Gets the list of accepted channel prefixes.
|
@NonNull List<ChannelUserMode> |
getChannelUserModes()
Gets the list of accepted channel user modes, such as op.
|
@NonNull Optional<ISupportParameter> |
getISupportParameter(@NonNull String name)
Gets the named ISUPPORT parameter if present.
|
@NonNull Map<String,ISupportParameter> |
getISupportParameters()
Gets the ISUPPORT parameters sent to the client.
|
@NonNull Optional<List<String>> |
getMotd()
Gets the server's MOTD.
|
@NonNull Optional<ChannelUserMode> |
getTargetedChannelInfo(@NonNull String name)
Gets the channel user mode for a targeted channel name, such as
+#channel targeting voiced users.
|
@NonNull List<UserMode> |
getUserModes()
Gets the user modes available.
|
@NonNull Optional<String> |
getVersion()
Gets the version of the IRCd.
|
boolean |
isValidChannel(@NonNull String name)
Gets if a given string is a valid channel name according to the
available server information.
|
void |
setAddress(@NonNull String serverAddress)
Sets the server address.
|
void |
setMotd(@NonNull List<String> motd)
Sets the MOTD.
|
void |
setUserModes(@NonNull List<UserMode> userModes)
Sets the user modes.
|
void |
setVersion(@NonNull String version)
Sets the version.
|
@NonNull String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAwayReasonLengthLimit, getCaseMapping, getChannelLengthLimit, getChannelLimits, getChannelMode, getChannelUserMode, getISupportParameter, getKickReasonLengthLimit, getNetworkName, getNickLengthLimit, getTopicLengthLimit, hasWhoXSupport
public DefaultServerInfo(@NonNull Client client)
client
- client for which this manager will operatepublic void addCustomChannelMode(@NonNull ChannelMode mode)
ServerInfo
addCustomChannelMode
in interface ServerInfo
mode
- custom mode to supportpublic void addCustomUserMode(@NonNull UserMode mode)
ServerInfo
addCustomUserMode
in interface ServerInfo
mode
- custom mode to supportpublic @NonNull Optional<String> getAddress()
ServerInfo
getAddress
in interface ServerInfo
public void setAddress(@NonNull String serverAddress)
ServerInfo.WithManagement
setAddress
in interface ServerInfo.WithManagement
serverAddress
- server addresspublic @NonNull List<ChannelMode> getChannelModes()
ServerInfo
getChannelModes
in interface ServerInfo
public @NonNull List<Character> getChannelPrefixes()
ServerInfo
getChannelPrefixes
in interface ServerInfo
public @NonNull List<ChannelUserMode> getChannelUserModes()
ServerInfo
getChannelUserModes
in interface ServerInfo
public @NonNull Optional<ISupportParameter> getISupportParameter(@NonNull String name)
ServerInfo
getISupportParameter
in interface ServerInfo
name
- parameter name, case insensitivepublic @NonNull Map<String,ISupportParameter> getISupportParameters()
ServerInfo
getISupportParameters
in interface ServerInfo
public void addISupportParameter(@NonNull ISupportParameter parameter)
ServerInfo.WithManagement
addISupportParameter
in interface ServerInfo.WithManagement
parameter
- parameter to addpublic @NonNull Optional<List<String>> getMotd()
ServerInfo
getMotd
in interface ServerInfo
public void setMotd(@NonNull List<String> motd)
ServerInfo.WithManagement
setMotd
in interface ServerInfo.WithManagement
motd
- motdpublic @NonNull Optional<String> getVersion()
ServerInfo
getVersion
in interface ServerInfo
public void setVersion(@NonNull String version)
ServerInfo.WithManagement
setVersion
in interface ServerInfo.WithManagement
version
- versionpublic boolean isValidChannel(@NonNull String name)
ServerInfo
isValidChannel
in interface ServerInfo
name
- potentially valid namepublic @NonNull Optional<ChannelUserMode> getTargetedChannelInfo(@NonNull String name)
ServerInfo.WithManagement
getTargetedChannelInfo
in interface ServerInfo.WithManagement
name
- channel name with mode tagpublic @NonNull List<UserMode> getUserModes()
ServerInfo
getUserModes
in interface ServerInfo
public void setUserModes(@NonNull List<UserMode> userModes)
ServerInfo.WithManagement
setUserModes
in interface ServerInfo.WithManagement
userModes
- user modesCopyright © 2013–2021 Kitteh. All rights reserved.