Record Class ComponentNamespace

java.lang.Object
java.lang.Record
tech.skworks.tachyon.api.component.ComponentNamespace
Record Components:
pluginName - The lowercase plugin name.
componentName - The lowercase component name.
fullNamespace - The pre-computed canonical namespace (e.g. "plugin:component").

public record ComponentNamespace(String pluginName, String componentName, String fullNamespace) extends Record
Immutable, namespace representation for Tachyon components.

Project Tachyon

Since:
2.0.0-SNAPSHOT
Version:
1.1
Author:
Jimmy (vSKAH) - 23/08/2026
  • Constructor Details

    • ComponentNamespace

      public ComponentNamespace(String pluginName, String componentName, String fullNamespace)
      Canonical constructor with validation and pre-computed full namespace.
  • Method Details

    • of

      public static ComponentNamespace of(String pluginName, String componentName)
      Factory method with strict regex validation and lowercase normalization.
      Parameters:
      pluginName - Name of the plugin (letters only).
      componentName - Name of the component (letters only).
      Returns:
      A memory-optimized ComponentNameSpace instance.
    • parse

      public static ComponentNamespace parse(String raw)
      Parses a raw namespace string in the format "plugin:component".
      Parameters:
      raw - The raw formatted namespace string.
      Returns:
      A memory-optimized ComponentNameSpace instance.
    • toString

      @NotNull public @NotNull 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.
    • pluginName

      public String pluginName()
      Returns the value of the pluginName record component.
      Returns:
      the value of the pluginName record component
    • componentName

      public String componentName()
      Returns the value of the componentName record component.
      Returns:
      the value of the componentName record component
    • fullNamespace

      public String fullNamespace()
      Returns the value of the fullNamespace record component.
      Returns:
      the value of the fullNamespace record component