Package io.micronaut.serde.support.util
Record Class SubtypeInfo
java.lang.Object
java.lang.Record
io.micronaut.serde.support.util.SubtypeInfo
- Record Components:
subtypes- The subtypesdiscriminatorType- The discriminator typediscriminatorName- The discriminator namedefaultImpl- The default impldiscriminatorVisible- The discriminator visible
@Internal
public record SubtypeInfo(@NonNull Map<Class<?>,String[]> subtypes, io.micronaut.serde.config.annotation.SerdeConfig.SerSubtyped.DiscriminatorType discriminatorType, @NonNull String discriminatorName, @Nullable Class<?> defaultImpl, boolean discriminatorVisible)
extends Record
The subtype info.
-
Constructor Summary
ConstructorsConstructorDescriptionSubtypeInfo(@NonNull Map<Class<?>, String[]> subtypes, io.micronaut.serde.config.annotation.SerdeConfig.SerSubtyped.DiscriminatorType discriminatorType, @NonNull String discriminatorName, @Nullable Class<?> defaultImpl, boolean discriminatorVisible) Creates an instance of aSubtypeInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SubtypeInfocreateForProperty(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) static SubtypeInfocreateForType(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) @Nullable Class<?>Returns the value of thedefaultImplrecord component.@NonNull StringReturns the value of thediscriminatorNamerecord component.io.micronaut.serde.config.annotation.SerdeConfig.SerSubtyped.DiscriminatorTypeReturns the value of thediscriminatorTyperecord component.booleanReturns the value of thediscriminatorVisiblerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.subtypes()Returns the value of thesubtypesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SubtypeInfo
public SubtypeInfo(@NonNull @NonNull Map<Class<?>, String[]> subtypes, @NonNull io.micronaut.serde.config.annotation.SerdeConfig.SerSubtyped.DiscriminatorType discriminatorType, @NonNull @NonNull String discriminatorName, @Nullable @Nullable Class<?> defaultImpl, boolean discriminatorVisible) Creates an instance of aSubtypeInforecord class.- Parameters:
subtypes- the value for thesubtypesrecord componentdiscriminatorType- the value for thediscriminatorTyperecord componentdiscriminatorName- the value for thediscriminatorNamerecord componentdefaultImpl- the value for thedefaultImplrecord componentdiscriminatorVisible- the value for thediscriminatorVisiblerecord component
-
-
Method Details
-
createForProperty
public static SubtypeInfo createForProperty(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) -
createForType
public static SubtypeInfo createForType(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) -
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. -
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. -
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 '=='. -
subtypes
Returns the value of thesubtypesrecord component.- Returns:
- the value of the
subtypesrecord component
-
discriminatorType
@NonNull public io.micronaut.serde.config.annotation.SerdeConfig.SerSubtyped.DiscriminatorType discriminatorType()Returns the value of thediscriminatorTyperecord component.- Returns:
- the value of the
discriminatorTyperecord component
-
discriminatorName
Returns the value of thediscriminatorNamerecord component.- Returns:
- the value of the
discriminatorNamerecord component
-
defaultImpl
Returns the value of thedefaultImplrecord component.- Returns:
- the value of the
defaultImplrecord component
-
discriminatorVisible
public boolean discriminatorVisible()Returns the value of thediscriminatorVisiblerecord component.- Returns:
- the value of the
discriminatorVisiblerecord component
-