Package de.exlll.configlib
Annotation Interface PolymorphicTypes
Indicates the subtypes of
Polymorphic types. This annotation can be used to provide type
aliases for subtypes which are then used instead of Java class names.
@Polymorphic
@PolymorphicTypes( {
@PolymorphicTypes.Type(type = Impl1.class, alias = "IMPL_1"),
@PolymorphicTypes.Type(type = Impl2.class, alias = "IMPL_2")
})
interface A { ... }
record Impl1(...) implements A { ... }
record Impl2(...) implements A { ... }
List<A> as = List.of(new Impl1(...), new Impl2(...), ...);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceIndicates a subtype of aPolymorphictype. -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionReturns (possibly only a subset of) the subtypes of the annotated type.
-
Element Details
-
value
PolymorphicTypes.Type[] valueReturns (possibly only a subset of) the subtypes of the annotated type.- Returns:
- subtypes of the annotated type
-