Class RecordSerdeShapeResolver

java.lang.Object
io.micronaut.serde.processor.sourcegen.records.RecordSerdeShapeResolver

public final class RecordSerdeShapeResolver extends Object
Resolves record shapes eligible for source-generated serdes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isConstructorBean(io.micronaut.inject.ast.ClassElement element)
    Whether a class binds every property through its primary constructor, so that the record generators apply: the constructor takes at least one parameter, every parameter names a bean property of the same type, and every bean property is such a parameter.
    resolve(io.micronaut.inject.ast.ClassElement element)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RecordSerdeShapeResolver

      public RecordSerdeShapeResolver()
  • Method Details

    • resolve

      public Optional<RecordSerdeShape> resolve(io.micronaut.inject.ast.ClassElement element)
    • isConstructorBean

      public static boolean isConstructorBean(io.micronaut.inject.ast.ClassElement element)
      Whether a class binds every property through its primary constructor, so that the record generators apply: the constructor takes at least one parameter, every parameter names a bean property of the same type, and every bean property is such a parameter. A property outside the constructor would be written or set by the runtime serdes through other means.
      Parameters:
      element - The type
      Returns:
      true if the type is bound through its constructor like a record