Record Class ClassScanningIndex

java.lang.Object
java.lang.Record
org.daiitech.naftah.utils.reflect.ClassScanningIndex
Record Components:
classNames - set of fully qualified class names available in the runtime
classQualifiers - set of simplified or alternative class identifiers used for lookup
arabicClassQualifiers - mapping of Arabic-transliterated identifiers to canonical class names
builtinFunctions - array of precomputed built-in function metadata descriptors

public record ClassScanningIndex(Set<String> classNames, Set<String> classQualifiers, Map<String,String> arabicClassQualifiers, BuiltinFunctionInfo[] builtinFunctions) extends Record
Precomputed lightweight runtime index used for fast class and built-in function resolution.

This record represents a serialized subset of the full ClassScanningResult, optimized for fast startup and minimal memory footprint. It is primarily used in environments where full classpath scanning is too expensive (e.g., browser-based or embedded Naftah Playground runtimes).

The index contains only essential metadata required for lookup operations:

  • Available class names
  • Class qualifiers (human-readable or alias names)
  • Arabic-transliterated class name mappings
  • Built-in function metadata (without reflective resolution)

This structure is intentionally immutable and designed for fast deserialization and lookup, not for direct execution or reflection.

Author:
Chakib Daii
  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Returns a lightweight identity-based string representation.

      This intentionally does not print internal data to avoid large log output and to keep debugging output stable across builds.

      Specified by:
      toString in class Record
      Returns:
      identity-based string representation of this index instance
    • 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.
    • classNames

      public Set<String> classNames()
      Returns the value of the classNames record component.
      Returns:
      the value of the classNames record component
    • classQualifiers

      public Set<String> classQualifiers()
      Returns the value of the classQualifiers record component.
      Returns:
      the value of the classQualifiers record component
    • arabicClassQualifiers

      public Map<String,String> arabicClassQualifiers()
      Returns the value of the arabicClassQualifiers record component.
      Returns:
      the value of the arabicClassQualifiers record component
    • builtinFunctions

      public BuiltinFunctionInfo[] builtinFunctions()
      Returns the value of the builtinFunctions record component.
      Returns:
      the value of the builtinFunctions record component