Class DefaultDomain

java.lang.Object
com.sk89q.worldguard.domains.DefaultDomain
All Implemented Interfaces:
Domain, ChangeTracked

public class DefaultDomain extends Object implements Domain, ChangeTracked
A combination of a PlayerDomain and a GroupDomain.
  • Constructor Details

    • DefaultDomain

      public DefaultDomain()
      Create a new domain.
    • DefaultDomain

      public DefaultDomain(DefaultDomain existing)
      Create a new domain from an existing one, making a copy of all values.
      Parameters:
      existing - the other domain to copy values from
  • Method Details

    • getPlayerDomain

      public PlayerDomain getPlayerDomain()
      Get the domain that holds the players.
      Returns:
      a domain
    • setPlayerDomain

      public void setPlayerDomain(PlayerDomain playerDomain)
      Set a new player domain.
      Parameters:
      playerDomain - a domain
    • getGroupDomain

      public GroupDomain getGroupDomain()
      Set the domain that holds the groups.
      Returns:
      a domain
    • setGroupDomain

      public void setGroupDomain(GroupDomain groupDomain)
      Set a new group domain.
      Parameters:
      groupDomain - a domain
    • addPlayer

      public void addPlayer(String name)
      Add the given player to the domain, identified by the player's name.
      Parameters:
      name - the name of the player
    • removePlayer

      public void removePlayer(String name)
      Remove the given player from the domain, identified by the player's name.
      Parameters:
      name - the name of the player
    • removePlayer

      public void removePlayer(UUID uuid)
      Remove the given player from the domain, identified by the player's UUID.
      Parameters:
      uuid - the UUID of the player
    • addPlayer

      public void addPlayer(UUID uniqueId)
      Add the given player to the domain, identified by the player's UUID.
      Parameters:
      uniqueId - the UUID of the player
    • removePlayer

      public 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.
      Parameters:
      player - the player
    • addPlayer

      public void addPlayer(LocalPlayer player)
      Add the given player to the domain, identified by the player's UUID.
      Parameters:
      player - the player
    • addAll

      public void addAll(DefaultDomain other)
      Add all the entries from another domain.
      Parameters:
      other - the other domain
    • removeAll

      public void removeAll(DefaultDomain other)
      Remove all the entries from another domain.
      Parameters:
      other - the other domain
    • getPlayers

      public Set<String> getPlayers()
      Get the set of player names.
      Returns:
      the set of player names
    • getUniqueIds

      public Set<UUID> getUniqueIds()
      Get the set of player UUIDs.
      Returns:
      the set of player UUIDs
    • addGroup

      public void addGroup(String name)
      Add the name of the group to the domain.
      Parameters:
      name - the name of the group.
    • removeGroup

      public void removeGroup(String name)
      Remove the given group from the domain.
      Parameters:
      name - the name of the group
    • getGroups

      public Set<String> getGroups()
      Get the set of group names.
      Returns:
      the set of group names
    • contains

      public boolean contains(LocalPlayer player)
      Description copied from interface: Domain
      Returns true if a domain contains a player.
      Specified by:
      contains in interface Domain
      Parameters:
      player - the player to check
      Returns:
      whether this domain contains player
    • contains

      public boolean contains(UUID uniqueId)
      Description copied from interface: Domain
      Returns true if a domain contains a player.

      This method doesn't check for groups!

      Specified by:
      contains in interface Domain
      Parameters:
      uniqueId - the UUID of the user
      Returns:
      whether this domain contains a player by that name
    • contains

      public boolean contains(String playerName)
      Description copied from interface: Domain
      Returns true if a domain contains a player.

      This method doesn't check for groups!

      Specified by:
      contains in interface Domain
      Parameters:
      playerName - The name of the player to check
      Returns:
      whether this domain contains a player by that name
    • size

      public int size()
      Description copied from interface: Domain
      Get the number of entries.
      Specified by:
      size in interface Domain
      Returns:
      the number of entries
    • clear

      public void clear()
      Description copied from interface: Domain
      Remove all entries.
      Specified by:
      clear in interface Domain
    • removeAll

      public void removeAll()
    • toPlayersString

      public String toPlayersString()
    • toPlayersString

      public String toPlayersString(@Nullable com.sk89q.worldguard.util.profile.cache.ProfileCache cache)
    • toGroupsString

      public String toGroupsString()
    • toUserFriendlyString

      public String toUserFriendlyString()
    • toUserFriendlyString

      public String toUserFriendlyString(com.sk89q.worldguard.util.profile.cache.ProfileCache cache)
    • toUserFriendlyComponent

      public com.sk89q.worldedit.util.formatting.text.Component toUserFriendlyComponent(@Nullable com.sk89q.worldguard.util.profile.cache.ProfileCache cache)
    • isDirty

      public boolean isDirty()
      Description copied from interface: ChangeTracked
      Tests whether changes have been made.
      Specified by:
      isDirty in interface ChangeTracked
      Returns:
      true if changes have been made
    • setDirty

      public void setDirty(boolean dirty)
      Description copied from interface: ChangeTracked
      Set whether changes have been made.
      Specified by:
      setDirty in interface ChangeTracked
      Parameters:
      dirty - a new dirty state
    • toString

      public String toString()
      Overrides:
      toString in class Object