Record Class ModelUtils.GeneratedModel

java.lang.Object
java.lang.Record
io.micronaut.sourcegen.generator.visitors.ModelUtils.GeneratedModel
Record Components:
model - The generated model object def
source - The source of the model
convertorMethod - The method that converts model to source
type - The type of the mode
Enclosing class:
ModelUtils

public static record ModelUtils.GeneratedModel(io.micronaut.sourcegen.model.ObjectDef model, io.micronaut.inject.ast.ClassElement source, io.micronaut.sourcegen.model.MethodDef convertorMethod, io.micronaut.sourcegen.model.TypeDef type) extends Record
A record for holding the generated model.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeneratedModel(io.micronaut.sourcegen.model.ObjectDef model, io.micronaut.inject.ast.ClassElement source, io.micronaut.sourcegen.model.MethodDef convertorMethod, io.micronaut.sourcegen.model.TypeDef type)
    Creates an instance of a GeneratedModel record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.sourcegen.model.MethodDef
    Returns the value of the convertorMethod record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    io.micronaut.sourcegen.model.ObjectDef
    Returns the value of the model record component.
    io.micronaut.inject.ast.ClassElement
    Returns the value of the source record component.
    final String
    Returns a string representation of this record class.
    io.micronaut.sourcegen.model.TypeDef
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

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

    • GeneratedModel

      public GeneratedModel(io.micronaut.sourcegen.model.ObjectDef model, io.micronaut.inject.ast.ClassElement source, io.micronaut.sourcegen.model.MethodDef convertorMethod, io.micronaut.sourcegen.model.TypeDef type)
      Creates an instance of a GeneratedModel record class.
      Parameters:
      model - the value for the model record component
      source - the value for the source record component
      convertorMethod - the value for the convertorMethod record component
      type - the value for the type 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.
    • model

      public io.micronaut.sourcegen.model.ObjectDef model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • source

      public io.micronaut.inject.ast.ClassElement source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • convertorMethod

      public io.micronaut.sourcegen.model.MethodDef convertorMethod()
      Returns the value of the convertorMethod record component.
      Returns:
      the value of the convertorMethod record component
    • type

      public io.micronaut.sourcegen.model.TypeDef type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component