Class AnnotationTypedConfig<T>

  • Type Parameters:
    T - the config type parameter
    All Implemented Interfaces:
    TypedConfig<T>

    public final class AnnotationTypedConfig<T>
    extends Object
    implements TypedConfig<T>
    Default implementation of TypedConfig.
    • Method Detail

      • getType

        @NotNull
        public @NotNull Class<T> getType()
        Description copied from interface: TypedConfig
        The config type. This will only be an annotation type or an interface type.
        Specified by:
        getType in interface TypedConfig<T>
        Returns:
        the config type
      • getConfig

        @NotNull
        public T getConfig()
        Description copied from interface: TypedConfig
        The config object. This is the value that is expected to be passed to an Activate-annotated SCR component constructor.
        Specified by:
        getConfig in interface TypedConfig<T>
        Returns:
        the config object
      • getConfigMap

        @NotNull
        public @NotNull Map<String,​Object> getConfigMap()
        Description copied from interface: TypedConfig
        Convert the config instance into a traditional config property map.
        Specified by:
        getConfigMap in interface TypedConfig<T>
        Returns:
        a property map
      • newInstance

        public static <T> AnnotationTypedConfig<T> newInstance​(@NotNull
                                                               @NotNull Class<T> type,
                                                               @NotNull
                                                               @NotNull Object config,
                                                               @NotNull
                                                               @NotNull Annotation annotation)
        Constructs a new instance of a AnnotationTypedConfig.
        Type Parameters:
        T - the config type
        Parameters:
        type - the config type
        config - the config value
        annotation - the annotation that provided the type
        Returns:
        a new instance