Record Class DefaultCategory

java.lang.Object
java.lang.Record
johnsmith.configoverhauled.impl.core.state.DefaultCategory
All Implemented Interfaces:
Category

public record DefaultCategory(String id, ConfigManager manager) extends Record implements Category
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a DefaultCategory record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Allocates or retrieves a subsidiary structural group within this category.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    id()
    Returns the value of the id record component.
    boolean
    Evaluates the active state of the category's structural hierarchy.
    Returns the value of the manager record component.
    void
    remove(Group group)
    Severs the structural bond between this category and the specified group.
    final String
    Returns a string representation of this record class.
    Retrieves the base localization key utilized for client-side GUI translation.

    Methods inherited from class Object

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

    • DefaultCategory

      public DefaultCategory(String id, ConfigManager manager)
      Creates an instance of a DefaultCategory record class.
      Parameters:
      id - the value for the id record component
      manager - the value for the manager record component
  • Method Details

    • translationKey

      public String translationKey()
      Description copied from interface: Category
      Retrieves the base localization key utilized for client-side GUI translation.
      Specified by:
      translationKey in interface Category
      Returns:
      The formatted translation key string.
    • define

      public Group define(String id)
      Description copied from interface: Category
      Allocates or retrieves a subsidiary structural group within this category.
      Specified by:
      define in interface Category
      Parameters:
      id - The target group identifier.
      Returns:
      The bound Group instance.
    • remove

      public void remove(Group group)
      Description copied from interface: Category
      Severs the structural bond between this category and the specified group.
      Specified by:
      remove in interface Category
      Parameters:
      group - The target group to remove.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Category
      Evaluates the active state of the category's structural hierarchy.
      Specified by:
      isEmpty in interface Category
      Returns:
      True if no subsidiary groups are registered.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Specified by:
      id in interface Category
      Returns:
      the value of the id record component
    • manager

      public ConfigManager manager()
      Returns the value of the manager record component.
      Specified by:
      manager in interface Category
      Returns:
      the value of the manager record component