Record Class RecordSerdeShape.RecordComponent

java.lang.Object
java.lang.Record
io.micronaut.serde.processor.sourcegen.records.RecordSerdeShape.RecordComponent
Record Components:
name - The component name.
serializedName - The serialized component name.
type - The component type.
keyMetadata - Pre-resolved metadata contributed with the component key.
include - The inclusion resolved at build time, or null when the configuration decides.
required - Whether the component has to be present in the input.
aliases - Additional names the component is read from.
nonNull - Whether the component rejects null, declared on the parameter or the property.
nullable - Whether the component accepts null, declared on the parameter or the property.
propertyElement - The associated bean property element.
Enclosing class:
RecordSerdeShape

public static record RecordSerdeShape.RecordComponent(String name, String serializedName, io.micronaut.inject.ast.ClassElement type, Map<String,String> keyMetadata, @Nullable SerdeConfig.SerInclude include, boolean required, List<String> aliases, boolean nonNull, boolean nullable, io.micronaut.inject.ast.PropertyElement propertyElement) extends Record
Record component metadata used by source generation.
  • Constructor Details

    • RecordComponent

      public RecordComponent(String name, io.micronaut.inject.ast.ClassElement type, io.micronaut.inject.ast.PropertyElement propertyElement)
      Creates a component whose serialized name matches its Java name and has no key metadata.
      Parameters:
      name - The component name.
      type - The component type.
      propertyElement - The associated bean property element.
    • RecordComponent

      public RecordComponent(String name, String serializedName, io.micronaut.inject.ast.ClassElement type, Map<String,String> keyMetadata, @Nullable SerdeConfig.SerInclude include, boolean required, List<String> aliases, boolean nonNull, boolean nullable, io.micronaut.inject.ast.PropertyElement propertyElement)
      Creates an instance of a RecordComponent record class.
      Parameters:
      name - the value for the name record component
      serializedName - the value for the serializedName record component
      type - the value for the type record component
      keyMetadata - the value for the keyMetadata record component
      include - the value for the include record component
      required - the value for the required record component
      aliases - the value for the aliases record component
      nonNull - the value for the nonNull record component
      nullable - the value for the nullable record component
      propertyElement - the value for the propertyElement 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • serializedName

      public String serializedName()
      Returns the value of the serializedName record component.
      Returns:
      the value of the serializedName record component
    • type

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

      public Map<String,String> keyMetadata()
      Returns the value of the keyMetadata record component.
      Returns:
      the value of the keyMetadata record component
    • include

      public @Nullable SerdeConfig.SerInclude include()
      Returns the value of the include record component.
      Returns:
      the value of the include record component
    • required

      public boolean required()
      Returns the value of the required record component.
      Returns:
      the value of the required record component
    • aliases

      public List<String> aliases()
      Returns the value of the aliases record component.
      Returns:
      the value of the aliases record component
    • nonNull

      public boolean nonNull()
      Returns the value of the nonNull record component.
      Returns:
      the value of the nonNull record component
    • nullable

      public boolean nullable()
      Returns the value of the nullable record component.
      Returns:
      the value of the nullable record component
    • propertyElement

      public io.micronaut.inject.ast.PropertyElement propertyElement()
      Returns the value of the propertyElement record component.
      Returns:
      the value of the propertyElement record component