Record Class BeanSerdeShape.BeanProperty
java.lang.Object
java.lang.Record
io.micronaut.serde.processor.sourcegen.beans.BeanSerdeShape.BeanProperty
- Record Components:
name- Property name.serializationType- Property type used for serialization.deserializationType- Property type used for deserialization.nonNull- Whether the property is non-null.nullable- Whether the property is nullable.keyMetadata- Pre-resolved metadata contributed with the property key.include- The inclusion resolved at build time, ornullwhen the configuration decides.required- Whether the property has to be present and non-null in the input.aliases- Additional names the property is read from.readMethod- Bean getter method.writeMethod- Bean setter method.readField- Bean field used for reading.writeField- Bean field used for writing.
- Enclosing class:
BeanSerdeShape
public static record BeanSerdeShape.BeanProperty(String name, io.micronaut.inject.ast.ClassElement serializationType, io.micronaut.inject.ast.ClassElement deserializationType, boolean nonNull, boolean nullable, Map<String,String> keyMetadata, @Nullable SerdeConfig.SerInclude include, boolean required, List<String> aliases, @Nullable io.micronaut.inject.ast.MethodElement readMethod, @Nullable io.micronaut.inject.ast.MethodElement writeMethod, @Nullable io.micronaut.inject.ast.FieldElement readField, @Nullable io.micronaut.inject.ast.FieldElement writeField)
extends Record
Bean property metadata used by source generation.
-
Constructor Summary
ConstructorsConstructorDescriptionBeanProperty(String name, io.micronaut.inject.ast.ClassElement serializationType, io.micronaut.inject.ast.ClassElement deserializationType, boolean nonNull, boolean nullable, @Nullable io.micronaut.inject.ast.MethodElement readMethod, @Nullable io.micronaut.inject.ast.MethodElement writeMethod, @Nullable io.micronaut.inject.ast.FieldElement readField, @Nullable io.micronaut.inject.ast.FieldElement writeField) Creates a property without contributed key metadata.BeanProperty(String name, io.micronaut.inject.ast.ClassElement serializationType, io.micronaut.inject.ast.ClassElement deserializationType, boolean nonNull, boolean nullable, Map<String, String> keyMetadata, @Nullable SerdeConfig.SerInclude include, boolean required, List<String> aliases, @Nullable io.micronaut.inject.ast.MethodElement readMethod, @Nullable io.micronaut.inject.ast.MethodElement writeMethod, @Nullable io.micronaut.inject.ast.FieldElement readField, @Nullable io.micronaut.inject.ast.FieldElement writeField) Creates an instance of aBeanPropertyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns the value of thealiasesrecord component.io.micronaut.inject.ast.ClassElementReturns the value of thedeserializationTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable SerdeConfig.SerIncludeinclude()Returns the value of theincluderecord component.Returns the value of thekeyMetadatarecord component.name()Returns the value of thenamerecord component.booleannonNull()Returns the value of thenonNullrecord component.booleannullable()Returns the value of thenullablerecord component.@Nullable io.micronaut.inject.ast.FieldElementReturns the value of thereadFieldrecord component.@Nullable io.micronaut.inject.ast.MethodElementReturns the value of thereadMethodrecord component.booleanrequired()Returns the value of therequiredrecord component.io.micronaut.inject.ast.ClassElementReturns the value of theserializationTyperecord component.final StringtoString()Returns a string representation of this record class.@Nullable io.micronaut.inject.ast.FieldElementReturns the value of thewriteFieldrecord component.@Nullable io.micronaut.inject.ast.MethodElementReturns the value of thewriteMethodrecord component.
-
Constructor Details
-
BeanProperty
public BeanProperty(String name, io.micronaut.inject.ast.ClassElement serializationType, io.micronaut.inject.ast.ClassElement deserializationType, boolean nonNull, boolean nullable, @Nullable io.micronaut.inject.ast.MethodElement readMethod, @Nullable io.micronaut.inject.ast.MethodElement writeMethod, @Nullable io.micronaut.inject.ast.FieldElement readField, @Nullable io.micronaut.inject.ast.FieldElement writeField) Creates a property without contributed key metadata.- Parameters:
name- Property name.serializationType- Property type used for serialization.deserializationType- Property type used for deserialization.nonNull- Whether the property is non-null.nullable- Whether the property is nullable.readMethod- Bean getter method.writeMethod- Bean setter method.readField- Bean field used for reading.writeField- Bean field used for writing.
-
BeanProperty
public BeanProperty(String name, io.micronaut.inject.ast.ClassElement serializationType, io.micronaut.inject.ast.ClassElement deserializationType, boolean nonNull, boolean nullable, Map<String, String> keyMetadata, @Nullable SerdeConfig.SerInclude include, boolean required, List<String> aliases, @Nullable io.micronaut.inject.ast.MethodElement readMethod, @Nullable io.micronaut.inject.ast.MethodElement writeMethod, @Nullable io.micronaut.inject.ast.FieldElement readField, @Nullable io.micronaut.inject.ast.FieldElement writeField) Creates an instance of aBeanPropertyrecord class.- Parameters:
name- the value for thenamerecord componentserializationType- the value for theserializationTyperecord componentdeserializationType- the value for thedeserializationTyperecord componentnonNull- the value for thenonNullrecord componentnullable- the value for thenullablerecord componentkeyMetadata- the value for thekeyMetadatarecord componentinclude- the value for theincluderecord componentrequired- the value for therequiredrecord componentaliases- the value for thealiasesrecord componentreadMethod- the value for thereadMethodrecord componentwriteMethod- the value for thewriteMethodrecord componentreadField- the value for thereadFieldrecord componentwriteField- the value for thewriteFieldrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
serializationType
public io.micronaut.inject.ast.ClassElement serializationType()Returns the value of theserializationTyperecord component.- Returns:
- the value of the
serializationTyperecord component
-
deserializationType
public io.micronaut.inject.ast.ClassElement deserializationType()Returns the value of thedeserializationTyperecord component.- Returns:
- the value of the
deserializationTyperecord component
-
nonNull
-
nullable
-
keyMetadata
Returns the value of thekeyMetadatarecord component.- Returns:
- the value of the
keyMetadatarecord component
-
include
-
required
-
aliases
-
readMethod
public @Nullable io.micronaut.inject.ast.MethodElement readMethod()Returns the value of thereadMethodrecord component.- Returns:
- the value of the
readMethodrecord component
-
writeMethod
public @Nullable io.micronaut.inject.ast.MethodElement writeMethod()Returns the value of thewriteMethodrecord component.- Returns:
- the value of the
writeMethodrecord component
-
readField
-
writeField
public @Nullable io.micronaut.inject.ast.FieldElement writeField()Returns the value of thewriteFieldrecord component.- Returns:
- the value of the
writeFieldrecord component
-