Class GroupDomain

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

public class GroupDomain extends Object implements Domain, ChangeTracked
Contains groups in a domain.
  • Constructor Details

    • GroupDomain

      public GroupDomain()
      Create a new instance.
    • GroupDomain

      public GroupDomain(GroupDomain domain)
      Create a new instance with copies from another domain.
      Parameters:
      domain - the domain to copy values from
    • GroupDomain

      public GroupDomain(String[] groups)
      Create a new instance.
      Parameters:
      groups - an array of groups
  • Method Details

    • 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
    • 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
    • getGroups

      public Set<String> getGroups()
      Get the set of group names.
      Returns:
      the set of group names
    • 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