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, SerdeConfig.SerSubtyped.DiscriminatorType discriminatorType, @NonNull String discriminatorName, @Nullable Class<?> defaultImpl, boolean discriminatorVisible)
extends Record
The subtype info.
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorDescriptionSubtypeInfo
(@NonNull Map<Class<?>, String[]> subtypes, SerdeConfig.SerSubtyped.DiscriminatorType discriminatorType, @NonNull String discriminatorName, @Nullable Class<?> defaultImpl, boolean discriminatorVisible) Creates an instance of aSubtypeInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SubtypeInfo
createForProperty
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) static SubtypeInfo
createForType
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) @Nullable Class<?>
Returns the value of thedefaultImpl
record component.@NonNull String
Returns the value of thediscriminatorName
record component.Returns the value of thediscriminatorType
record component.boolean
Returns the value of thediscriminatorVisible
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.subtypes()
Returns the value of thesubtypes
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
SubtypeInfo
public SubtypeInfo(@NonNull @NonNull Map<Class<?>, String[]> subtypes, @NonNull SerdeConfig.SerSubtyped.DiscriminatorType discriminatorType, @NonNull @NonNull String discriminatorName, @Nullable @Nullable Class<?> defaultImpl, boolean discriminatorVisible) Creates an instance of aSubtypeInfo
record class.- Parameters:
subtypes
- the value for thesubtypes
record componentdiscriminatorType
- the value for thediscriminatorType
record componentdiscriminatorName
- the value for thediscriminatorName
record componentdefaultImpl
- the value for thedefaultImpl
record componentdiscriminatorVisible
- the value for thediscriminatorVisible
record 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 thesubtypes
record component.- Returns:
- the value of the
subtypes
record component
-
discriminatorType
Returns the value of thediscriminatorType
record component.- Returns:
- the value of the
discriminatorType
record component
-
discriminatorName
Returns the value of thediscriminatorName
record component.- Returns:
- the value of the
discriminatorName
record component
-
defaultImpl
Returns the value of thedefaultImpl
record component.- Returns:
- the value of the
defaultImpl
record component
-
discriminatorVisible
public boolean discriminatorVisible()Returns the value of thediscriminatorVisible
record component.- Returns:
- the value of the
discriminatorVisible
record component
-