public class DefaultDomain extends java.lang.Object implements Domain, ChangeTracked
PlayerDomain and a GroupDomain.| Constructor and Description |
|---|
DefaultDomain()
Create a new domain.
|
DefaultDomain(DefaultDomain existing)
Create a new domain from an existing one, making a copy of all values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(DefaultDomain other)
Add all the entries from another domain.
|
void |
addGroup(java.lang.String name)
Add the name of the group to the domain.
|
void |
addPlayer(LocalPlayer player)
Add the given player to the domain, identified by the player's UUID.
|
void |
addPlayer(java.lang.String name)
Add the given player to the domain, identified by the player's name.
|
void |
addPlayer(java.util.UUID uniqueId)
Add the given player to the domain, identified by the player's UUID.
|
void |
clear()
Remove all entries.
|
boolean |
contains(LocalPlayer player)
Returns true if a domain contains a player.
|
boolean |
contains(java.lang.String playerName)
Returns true if a domain contains a player.
|
boolean |
contains(java.util.UUID uniqueId)
Returns true if a domain contains a player.
|
GroupDomain |
getGroupDomain()
Set the domain that holds the groups.
|
java.util.Set<java.lang.String> |
getGroups()
Get the set of group names.
|
PlayerDomain |
getPlayerDomain()
Get the domain that holds the players.
|
java.util.Set<java.lang.String> |
getPlayers()
Get the set of player names.
|
java.util.Set<java.util.UUID> |
getUniqueIds()
Get the set of player UUIDs.
|
boolean |
isDirty()
Tests whether changes have been made.
|
void |
removeAll() |
void |
removeAll(DefaultDomain other)
Remove all the entries from another domain.
|
void |
removeGroup(java.lang.String name)
Remove the given group from the domain.
|
void |
removePlayer(LocalPlayer player)
Remove the given player from the domain, identified by either the
player's name, the player's unique ID, or both.
|
void |
removePlayer(java.lang.String name)
Remove the given player from the domain, identified by the player's name.
|
void |
removePlayer(java.util.UUID uuid)
Remove the given player from the domain, identified by the player's UUID.
|
void |
setDirty(boolean dirty)
Set whether changes have been made.
|
void |
setGroupDomain(GroupDomain groupDomain)
Set a new group domain.
|
void |
setPlayerDomain(PlayerDomain playerDomain)
Set a new player domain.
|
int |
size()
Get the number of entries.
|
java.lang.String |
toGroupsString() |
java.lang.String |
toPlayersString() |
java.lang.String |
toPlayersString(com.sk89q.squirrelid.cache.ProfileCache cache) |
java.lang.String |
toString() |
java.lang.String |
toUserFriendlyString() |
java.lang.String |
toUserFriendlyString(com.sk89q.squirrelid.cache.ProfileCache cache) |
public DefaultDomain()
public DefaultDomain(DefaultDomain existing)
existing - the other domain to copy values frompublic PlayerDomain getPlayerDomain()
public void setPlayerDomain(PlayerDomain playerDomain)
playerDomain - a domainpublic GroupDomain getGroupDomain()
public void setGroupDomain(GroupDomain groupDomain)
groupDomain - a domainpublic void addPlayer(java.lang.String name)
name - the name of the playerpublic void removePlayer(java.lang.String name)
name - the name of the playerpublic void removePlayer(java.util.UUID uuid)
uuid - the UUID of the playerpublic void addPlayer(java.util.UUID uniqueId)
uniqueId - the UUID of the playerpublic void removePlayer(LocalPlayer player)
player - the playerpublic void addPlayer(LocalPlayer player)
player - the playerpublic void addAll(DefaultDomain other)
other - the other domainpublic void removeAll(DefaultDomain other)
other - the other domainpublic java.util.Set<java.lang.String> getPlayers()
public java.util.Set<java.util.UUID> getUniqueIds()
public void addGroup(java.lang.String name)
name - the name of the group.public void removeGroup(java.lang.String name)
name - the name of the grouppublic java.util.Set<java.lang.String> getGroups()
public boolean contains(LocalPlayer player)
Domainpublic boolean contains(java.util.UUID uniqueId)
DomainThis method doesn't check for groups!
public boolean contains(java.lang.String playerName)
DomainThis method doesn't check for groups!
public int size()
Domainpublic void clear()
Domainpublic void removeAll()
public java.lang.String toPlayersString()
public java.lang.String toPlayersString(@Nullable
com.sk89q.squirrelid.cache.ProfileCache cache)
public java.lang.String toGroupsString()
public java.lang.String toUserFriendlyString()
public java.lang.String toUserFriendlyString(com.sk89q.squirrelid.cache.ProfileCache cache)
public boolean isDirty()
ChangeTrackedisDirty in interface ChangeTrackedpublic void setDirty(boolean dirty)
ChangeTrackedsetDirty in interface ChangeTrackeddirty - a new dirty statepublic java.lang.String toString()
toString in class java.lang.Object