Class ObjectGroup

java.lang.Object
com.palmergames.bukkit.towny.object.TownyObject
com.palmergames.bukkit.towny.object.ObjectGroup
All Implemented Interfaces:
Identifiable, Nameable, Savable
Direct Known Subclasses:
District, PlotGroup

public abstract class ObjectGroup extends TownyObject implements Identifiable
An abstract class which defines the mechanics of groups in towny.
Author:
Suneet Tipirneni (Siris)
  • Constructor Details

    • ObjectGroup

      public ObjectGroup(UUID id, String name)
      The constructor for the Group object.
      Parameters:
      id - A unique identifier for the group id.
      name - An alias for the id used for player in-game interaction via commands.
  • Method Details

    • getUUID

      public UUID getUUID()
      Specified by:
      getUUID in interface Identifiable
    • setUUID

      public void setUUID(UUID id)
      Description copied from interface: Identifiable
      This should only be used by internal loading methods!
      Specified by:
      setUUID in interface Identifiable
      Parameters:
      id - the UUID to set.
    • equals

      public boolean equals(Object obj)
      Determines whether a group is equivalent or not.
      Overrides:
      equals in class Object
      Parameters:
      obj - The group to be compared
      Returns:
      Returns true if the id (UUID) of the group matches the given group object. False otherwise.
    • toString

      public String toString()
      Converts this into the qualified string representation.
      Overrides:
      toString in class TownyObject
      Returns:
      A string in the format "name, id".
    • hashCode

      public int hashCode()
      Get hashcode for object group name. The reason we hash the name and not the UUID is for quicker common access from commands.
      Overrides:
      hashCode in class Object
      Returns:
      name hashcode