public class DefaultServerInfo extends Object implements ServerInfo.WithManagement
ServerInfo.WithManagement
Constructor and Description |
---|
DefaultServerInfo(Client client)
Constructs the server info.
|
Modifier and Type | Method and Description |
---|---|
void |
addISupportParameter(ISupportParameter parameter)
Adds an ISUPPORT parameter to the list of supported parameters.
|
Optional<String> |
getAddress()
Gets the server-stated address of the server.
|
List<ChannelMode> |
getChannelModes()
Gets the channel modes available.
|
List<Character> |
getChannelPrefixes()
Gets the list of accepted channel prefixes.
|
List<ChannelUserMode> |
getChannelUserModes()
Gets the list of accepted channel user modes, such as op.
|
Optional<ISupportParameter> |
getISupportParameter(String name)
Gets the named ISUPPORT parameter if present.
|
Map<String,ISupportParameter> |
getISupportParameters()
Gets the ISUPPORT parameters sent to the client.
|
Optional<List<String>> |
getMotd()
Gets the server's MOTD.
|
Optional<ChannelUserMode> |
getTargetedChannelInfo(String name)
Gets the channel user mode for a targeted channel name, such as
+#channel targeting voiced users.
|
List<UserMode> |
getUserModes()
Gets the user modes available.
|
Optional<String> |
getVersion()
Gets the version of the IRCd.
|
boolean |
isValidChannel(String name)
Gets if a given string is a valid channel name according to the
available server information.
|
void |
setAddress(String serverAddress)
Sets the server address.
|
void |
setMotd(List<String> motd)
Sets the MOTD.
|
void |
setUserModes(List<UserMode> userModes)
Sets the user modes.
|
void |
setVersion(String version)
Sets the version.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCaseMapping, getChannelLengthLimit, getChannelLimits, getChannelMode, getChannelUserMode, getISupportParameter, getNetworkName, getNickLengthLimit, hasWhoXSupport
@Nonnull public Optional<String> getAddress()
ServerInfo
getAddress
in interface ServerInfo
public void setAddress(@Nonnull String serverAddress)
ServerInfo.WithManagement
setAddress
in interface ServerInfo.WithManagement
serverAddress
- server address@Nonnull public List<ChannelMode> getChannelModes()
ServerInfo
getChannelModes
in interface ServerInfo
@Nonnull public List<Character> getChannelPrefixes()
ServerInfo
getChannelPrefixes
in interface ServerInfo
@Nonnull public List<ChannelUserMode> getChannelUserModes()
ServerInfo
getChannelUserModes
in interface ServerInfo
@Nonnull public Optional<ISupportParameter> getISupportParameter(@Nonnull String name)
ServerInfo
getISupportParameter
in interface ServerInfo
name
- parameter name, case insensitive@Nonnull public 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 add@Nonnull public Optional<List<String>> getMotd()
ServerInfo
getMotd
in interface ServerInfo
public void setMotd(@Nonnull List<String> motd)
ServerInfo.WithManagement
setMotd
in interface ServerInfo.WithManagement
motd
- motd@Nonnull public 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 name@Nonnull public Optional<ChannelUserMode> getTargetedChannelInfo(@Nonnull String name)
ServerInfo.WithManagement
getTargetedChannelInfo
in interface ServerInfo.WithManagement
name
- channel name with mode tag@Nonnull public 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–2019 Kitteh. All rights reserved.