Record Class BindingNode

java.lang.Object
java.lang.Record
build.codemodel.dependency.injection.BindingNode
Record Components:
typeDescriptor - the JDKTypeDescriptor for the concrete type, or null for value/supplier bindings where no class is directly tracked
scope - the scope annotation that governs this binding (e.g. Singleton.class), or null for prototype-scoped bindings
declaringModule - the Module subclass that registered this binding, or null when the binding was not registered through a module (Track 1 always passes null; Track 2 fills this in)
kind - how this binding produces its value

public record BindingNode(build.codemodel.jdk.descriptor.JDKTypeDescriptor typeDescriptor, Class<? extends Annotation> scope, Class<? extends Module> declaringModule, BindingKind kind) extends Record
A vertex in the Track 2 binding graph. Describes a single registered Binding: the type it produces, the scope it operates under, the Module that declared it (if any), and its BindingKind.

Instances are constructed by InjectionContext and passed to BindingGraphContributor.contributeBinding(BindingNode). Fields that cannot be populated in Track 1 (e.g. declaringModule when no module tracking is in place) are null.

Since:
Apr-2026
Author:
reed.vonredwitz
See Also:
  • Constructor Details

    • BindingNode

      public BindingNode(build.codemodel.jdk.descriptor.JDKTypeDescriptor typeDescriptor, Class<? extends Annotation> scope, Class<? extends Module> declaringModule, BindingKind kind)
      Creates an instance of a BindingNode record class.
      Parameters:
      typeDescriptor - the value for the typeDescriptor record component
      scope - the value for the scope record component
      declaringModule - the value for the declaringModule record component
      kind - the value for the kind record component
  • Method Details

    • 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.
    • typeDescriptor

      public build.codemodel.jdk.descriptor.JDKTypeDescriptor typeDescriptor()
      Returns the value of the typeDescriptor record component.
      Returns:
      the value of the typeDescriptor record component
    • scope

      public Class<? extends Annotation> scope()
      Returns the value of the scope record component.
      Returns:
      the value of the scope record component
    • declaringModule

      public Class<? extends Module> declaringModule()
      Returns the value of the declaringModule record component.
      Returns:
      the value of the declaringModule record component
    • kind

      public BindingKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component