Record Class EnumSerdeShape
java.lang.Object
java.lang.Record
io.micronaut.serde.processor.sourcegen.enums.EnumSerdeShape
- Record Components:
constants- Enum constants participating in generated mapping.hasPropertyOverrides- Whether any constant has an overridden serialized name.serializedValues- The serialized value of every constant, in declaration (ordinal) order.
public record EnumSerdeShape(List<EnumSerdeShape.EnumConstant> constants, boolean hasPropertyOverrides, List<String> serializedValues)
extends Record
Shape model for enum-based source generation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordEnum constant metadata used by source generation. -
Constructor Summary
ConstructorsConstructorDescriptionEnumSerdeShape(List<EnumSerdeShape.EnumConstant> constants, boolean hasPropertyOverrides) Deprecated, for removal: This API element is subject to removal in a future version.EnumSerdeShape(List<EnumSerdeShape.EnumConstant> constants, boolean hasPropertyOverrides, List<String> serializedValues) Creates an instance of aEnumSerdeShaperecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconstantsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasPropertyOverridesrecord component.booleanWhether every constant has its own serialized value, which then identifies the constant in both directions.Returns the value of theserializedValuesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EnumSerdeShape
@Deprecated(since="3.3.0", forRemoval=true) public EnumSerdeShape(List<EnumSerdeShape.EnumConstant> constants, boolean hasPropertyOverrides) Deprecated, for removal: This API element is subject to removal in a future version.Shape model without the serialized values; the generated code then can't match them.- Parameters:
constants- Enum constants participating in generated mapping.hasPropertyOverrides- Whether any constant has an overridden serialized name.
-
EnumSerdeShape
public EnumSerdeShape(List<EnumSerdeShape.EnumConstant> constants, boolean hasPropertyOverrides, List<String> serializedValues) Creates an instance of aEnumSerdeShaperecord class.- Parameters:
constants- the value for theconstantsrecord componenthasPropertyOverrides- the value for thehasPropertyOverridesrecord componentserializedValues- the value for theserializedValuesrecord component
-
-
Method Details
-
hasUniqueSerializedValues
public boolean hasUniqueSerializedValues()Whether every constant has its own serialized value, which then identifies the constant in both directions.- Returns:
- Whether the serialized values are unique
-
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. -
constants
-
hasPropertyOverrides
public boolean hasPropertyOverrides()Returns the value of thehasPropertyOverridesrecord component.- Returns:
- the value of the
hasPropertyOverridesrecord component
-
serializedValues
Returns the value of theserializedValuesrecord component.- Returns:
- the value of the
serializedValuesrecord component
-
EnumSerdeShape(List, boolean, List)