Class AnnotationTypedConfig<T>
- java.lang.Object
-
- org.apache.sling.testing.mock.osgi.config.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 ofTypedConfig.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetConfig()The config object.@NotNull Map<String,Object>getConfigMap()Convert the config instance into a traditional config property map.@NotNull Class<T>getType()The config type.static <T> AnnotationTypedConfig<T>newInstance(@NotNull Class<T> type, @NotNull Object config, @NotNull Annotation annotation)Constructs a new instance of aAnnotationTypedConfig.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sling.testing.mock.osgi.config.annotations.TypedConfig
configStream, stream
-
-
-
-
Method Detail
-
getType
@NotNull public @NotNull Class<T> getType()
Description copied from interface:TypedConfigThe config type. This will only be an annotation type or an interface type.- Specified by:
getTypein interfaceTypedConfig<T>- Returns:
- the config type
-
getConfig
@NotNull public T getConfig()
Description copied from interface:TypedConfigThe config object. This is the value that is expected to be passed to anActivate-annotated SCR component constructor.- Specified by:
getConfigin interfaceTypedConfig<T>- Returns:
- the config object
-
getConfigMap
@NotNull public @NotNull Map<String,Object> getConfigMap()
Description copied from interface:TypedConfigConvert the config instance into a traditional config property map.- Specified by:
getConfigMapin interfaceTypedConfig<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 aAnnotationTypedConfig.- Type Parameters:
T- the config type- Parameters:
type- the config typeconfig- the config valueannotation- the annotation that provided the type- Returns:
- a new instance
-
-