public class DefaultChannel extends DefaultStaleable implements Channel
Modifier and Type | Class and Description |
---|---|
static class |
DefaultChannel.DefaultChannelCommands
Default channel commands.
|
Channel.Commands, Channel.Topic
Constructor and Description |
---|
DefaultChannel(Client.WithManagement client,
@NonNull String name,
@NonNull Channel.Topic topic,
@NonNull ModeStatusList<ChannelMode> channelModes,
@NonNull Map<Character,List<ModeInfo>> modeInfoLists,
@NonNull Map<String,SortedSet<ChannelUserMode>> modes,
@NonNull List<String> names,
@NonNull Map<String,User> nickMap,
@NonNull List<User> users,
boolean complete,
@NonNull DefaultChannel.DefaultChannelCommands commands)
Constructs the channel snapshot.
|
Modifier and Type | Method and Description |
---|---|
@NonNull Channel.Commands |
commands()
Provides access to
Command s. |
boolean |
equals(Object o) |
@NonNull String |
getMessagingName()
Gets the name used when sending messages.
|
@NonNull Optional<List<ModeInfo>> |
getModeInfoList(@NonNull ChannelMode mode)
Gets the tracked mode info for the channel, if tracked.
|
@NonNull ModeStatusList<ChannelMode> |
getModes()
Gets the channel's current known modes.
|
@NonNull List<String> |
getNicknames()
Gets the nicknames of users in the channel, if the client is in the
channel.
|
@NonNull Channel.Topic |
getTopic()
Gets the channel's topic.
|
@NonNull Optional<User> |
getUser(@NonNull String nick)
Gets a user by their nick, if they are known to the client.
|
@NonNull Optional<SortedSet<ChannelUserMode>> |
getUserModes(@NonNull String nick)
Gets the user modes of a given nickname in the channel.
|
@NonNull List<User> |
getUsers()
Gets all Users known to be in the channel.
|
boolean |
hasCompleteUserData()
Gets if this Channel has complete user data available, only possible
if the Client is in the channel and the WHO list has sent.
|
int |
hashCode() |
void |
setModeInfoTracking(@NonNull ChannelMode mode,
boolean track)
Sets whether a particular type A mode should be tracked for this
channel, and sends a request for the full list.
|
@NonNull String |
toString() |
isStale
getClient, getCreationTime, getName
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLatest, getUserModes, join, join, kick, kick, part, part, setTopic
getLowerCaseMessagingName, sendCtcpMessage, sendMessage, sendMultiLineMessage, sendMultiLineMessage, sendMultiLineNotice, sendMultiLineNotice, sendNotice
getLowerCaseName, getName
getCreationTime
getClient
public DefaultChannel(Client.WithManagement client, @NonNull String name, @NonNull Channel.Topic topic, @NonNull ModeStatusList<ChannelMode> channelModes, @NonNull Map<Character,List<ModeInfo>> modeInfoLists, @NonNull Map<String,SortedSet<ChannelUserMode>> modes, @NonNull List<String> names, @NonNull Map<String,User> nickMap, @NonNull List<User> users, boolean complete, @NonNull DefaultChannel.DefaultChannelCommands commands)
client
- clientname
- channel nametopic
- topicchannelModes
- channel modesmodeInfoLists
- modeinfolistsmodes
- modesnames
- who is in the channelnickMap
- map of nicks to Usersusers
- userscomplete
- true if WHO completedcommands
- commands objectpublic @NonNull String getMessagingName()
MessageReceiver
getMessagingName
in interface MessageReceiver
public @NonNull Optional<List<ModeInfo>> getModeInfoList(@NonNull ChannelMode mode)
Channel
getModeInfoList
in interface Channel
mode
- type A mode to acquirepublic @NonNull ModeStatusList<ChannelMode> getModes()
Channel
public @NonNull List<String> getNicknames()
Channel
getNicknames
in interface Channel
public @NonNull Channel.Topic getTopic()
Channel
public @NonNull Optional<User> getUser(@NonNull String nick)
Channel
getUser
in interface Channel
nick
- user's nickChannel.hasCompleteUserData()
,
ChannelUsersUpdatedEvent
public @NonNull Optional<SortedSet<ChannelUserMode>> getUserModes(@NonNull String nick)
Channel
getUserModes
in interface Channel
nick
- user's nickpublic @NonNull List<User> getUsers()
Channel
Channel.getNicknames()
.getUsers
in interface Channel
Channel.hasCompleteUserData()
,
ChannelUsersUpdatedEvent
public boolean hasCompleteUserData()
Channel
hasCompleteUserData
in interface Channel
ChannelUsersUpdatedEvent
public void setModeInfoTracking(@NonNull ChannelMode mode, boolean track)
Channel
RequestedChannelJoinCompleteEvent
to ensure it's always set.setModeInfoTracking
in interface Channel
mode
- mode to tracktrack
- true to track, false to stop trackingChannelModeInfoListEvent
public @NonNull Channel.Commands commands()
Channel
Command
s.public @NonNull String toString()
toString
in class DefaultActor
Copyright © 2013–2021 Kitteh. All rights reserved.