Record Class ReflectionHelper.CanonicalBuilderInfo

java.lang.Object
java.lang.Record
org.tentackle.reflect.ReflectionHelper.CanonicalBuilderInfo
Record Components:
constructor - the builder constructor
methods - the builder's methods to set the attributes of the object to build
buildMethod - the method to build the object from the attributes set in the builder
Enclosing class:
ReflectionHelper

public static record ReflectionHelper.CanonicalBuilderInfo(Constructor<?> constructor, Map<String,Method> methods, Method buildMethod) extends Record
The canonical builder info.
Author:
harald
  • Constructor Details

    • CanonicalBuilderInfo

      public CanonicalBuilderInfo(Constructor<?> constructor, Map<String,Method> methods, Method buildMethod)
      Creates an instance of a CanonicalBuilderInfo record class.
      Parameters:
      constructor - the value for the constructor record component
      methods - the value for the methods record component
      buildMethod - the value for the buildMethod record component
  • Method Details

    • getMethod

      public Method getMethod(String name)
      Gets a builder method by name.
      Parameters:
      name - the name of the method
      Returns:
      the method, null for none
    • 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.
    • constructor

      public Constructor<?> constructor()
      Returns the value of the constructor record component.
      Returns:
      the value of the constructor record component
    • methods

      public Map<String,Method> methods()
      Returns the value of the methods record component.
      Returns:
      the value of the methods record component
    • buildMethod

      public Method buildMethod()
      Returns the value of the buildMethod record component.
      Returns:
      the value of the buildMethod record component