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,
String name,
Channel.Topic topic,
ModeStatusList<ChannelMode> channelModes,
Map<Character,List<ModeInfo>> modeInfoLists,
Map<String,SortedSet<ChannelUserMode>> modes,
List<String> names,
Map<String,User> nickMap,
List<User> users,
boolean complete,
DefaultChannel.DefaultChannelCommands commands)
Constructs the channel snapshot.
|
Modifier and Type | Method and Description |
---|---|
Channel.Commands |
commands()
Provides access to
Command s. |
boolean |
equals(Object o) |
String |
getMessagingName()
Gets the name used when sending messages.
|
Optional<List<ModeInfo>> |
getModeInfoList(ChannelMode mode)
Gets the tracked mode info for the channel, if tracked.
|
ModeStatusList<ChannelMode> |
getModes()
Gets the channel's current known modes.
|
List<String> |
getNicknames()
Gets the nicknames of users in the channel, if the client is in the
channel.
|
Channel.Topic |
getTopic()
Gets the channel's topic.
|
Optional<User> |
getUser(String nick)
Gets a user by their nick, if they are known to the client.
|
Optional<SortedSet<ChannelUserMode>> |
getUserModes(String nick)
Gets the user modes of a given nickname in the channel.
|
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(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.
|
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(@Nonnull 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 object@Nonnull public String getMessagingName()
MessageReceiver
getMessagingName
in interface MessageReceiver
@Nonnull public Optional<List<ModeInfo>> getModeInfoList(@Nonnull ChannelMode mode)
Channel
getModeInfoList
in interface Channel
mode
- type A mode to acquire@Nonnull public ModeStatusList<ChannelMode> getModes()
Channel
@Nonnull public List<String> getNicknames()
Channel
getNicknames
in interface Channel
@Nonnull public Channel.Topic getTopic()
Channel
@Nonnull public Optional<User> getUser(@Nonnull String nick)
Channel
getUser
in interface Channel
nick
- user's nickChannel.hasCompleteUserData()
,
ChannelUsersUpdatedEvent
@Nonnull public Optional<SortedSet<ChannelUserMode>> getUserModes(@Nonnull String nick)
Channel
getUserModes
in interface Channel
nick
- user's nick@Nonnull public 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
@Nonnull public Channel.Commands commands()
Channel
Command
s.@Nonnull public String toString()
toString
in class DefaultActor
Copyright © 2013–2019 Kitteh. All rights reserved.