Record Class AgiClassSource

java.lang.Object
java.lang.Record
uno.anahata.asi.toolkit.java.AgiClassSource
Record Components:
fqn - The fully qualified class name (e.g. "com.foo.Bar").
sourceCode - The complete Java source code of the class.
All Implemented Interfaces:
Displayable

public record AgiClassSource(@NonNull String fqn, @NonNull String sourceCode) extends Record implements Displayable
Immutable source code descriptor for an in-memory Java class.

Binds a fully qualified class name (FQN) to its complete Java source code. Used for batch compilation of modular architectures and circular dependencies.

Author:
anahata
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final @NonNull String
    The field for the fqn record component.
    private final @NonNull String
    The field for the sourceCode record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AgiClassSource(@NonNull String fqn, @NonNull String sourceCode)
    Canonical constructor validating that FQN and sourceCode are non-null and trimmed.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NonNull String
    fqn()
    Returns the value of the fqn record component.
    Returns the human-readable display value representing this entity in UI views.
    int
    Calculates the number of lines in the source code.
    final int
    Returns a hash code value for this object.
    @NonNull String
    Returns the value of the sourceCode record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • fqn

      @NonNull private final @NonNull String fqn
      The field for the fqn record component.
    • sourceCode

      @NonNull private final @NonNull String sourceCode
      The field for the sourceCode record component.
  • Constructor Details

    • AgiClassSource

      public AgiClassSource(@NonNull @NonNull String fqn, @NonNull @NonNull String sourceCode)
      Canonical constructor validating that FQN and sourceCode are non-null and trimmed.
      Parameters:
      fqn - The class FQN.
      sourceCode - The class source code.
  • Method Details

    • getLineCount

      public int getLineCount()
      Calculates the number of lines in the source code.
      Returns:
      Total line count.
    • getDisplayValue

      public String getDisplayValue()
      Returns the human-readable display value representing this entity in UI views.

      Returns the simple class name (the portion of fqn after the last dot) for concise UI tab headers and displays.

      Specified by:
      getDisplayValue in interface Displayable
      Returns:
      The display string.
    • 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.
    • fqn

      @NonNull public @NonNull String fqn()
      Returns the value of the fqn record component.
      Returns:
      the value of the fqn record component
    • sourceCode

      @NonNull public @NonNull String sourceCode()
      Returns the value of the sourceCode record component.
      Returns:
      the value of the sourceCode record component