Class PlayerDomain

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

public class PlayerDomain extends Object implements Domain, ChangeTracked
Stores players (only) in a domain.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instance.
    Create a new instance.
    PlayerDomain​(String[] names)
    Deprecated.
    names are deprecated in favor of UUIDs in MC 1.7+
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add the given player to the domain, identified by the player's UUID.
    void
    addPlayer​(String name)
    Deprecated.
    names are deprecated in favor of UUIDs in MC 1.7+
    void
    addPlayer​(UUID uniqueId)
    Add the given player to the domain, identified by the player's UUID.
    void
    Remove all entries.
    boolean
    contains​(LocalPlayer player)
    Returns true if a domain contains a player.
    boolean
    contains​(String playerName)
    Returns true if a domain contains a player.
    boolean
    contains​(UUID uniqueId)
    Returns true if a domain contains a player.
    Deprecated.
    names are deprecated in favor of UUIDs in MC 1.7+
    Get the set of player UUIDs.
    boolean
    Tests whether changes have been made.
    void
    Remove the given player from the domain, identified by either the player's name, the player's unique ID, or both.
    void
    Deprecated.
    names are deprecated in favor of UUIDs in MC 1.7+
    void
    removePlayer​(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.
    int
    Get the number of entries.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PlayerDomain

      public PlayerDomain()
      Create a new instance.
    • PlayerDomain

      public PlayerDomain(PlayerDomain domain)
      Create a new instance.
      Parameters:
      domain - the domain to copy values from
    • PlayerDomain

      @Deprecated public PlayerDomain(String[] names)
      Deprecated.
      names are deprecated in favor of UUIDs in MC 1.7+
      Create a new instance with the given names.
      Parameters:
      names - an array of names
  • Method Details

    • addPlayer

      @Deprecated public void addPlayer(String name)
      Deprecated.
      names are deprecated in favor of UUIDs in MC 1.7+
      Add the given player to the domain, identified by the player's name.
      Parameters:
      name - the name 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
    • addPlayer

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

      @Deprecated public void removePlayer(String name)
      Deprecated.
      names are deprecated in favor of UUIDs in MC 1.7+
      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
    • 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
    • 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
    • getPlayers

      @Deprecated public Set<String> getPlayers()
      Deprecated.
      names are deprecated in favor of UUIDs in MC 1.7+
      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
    • 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
    • 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