@ProviderType
public interface ConfigurationBuilder
Modifier and Type | Method and Description |
---|---|
<T> T |
as(@NotNull java.lang.Class<T> clazz)
Get configuration as singleton resource and its properties mapped to the given annotation class.
|
<T> T |
asAdaptable(@NotNull java.lang.Class<T> clazz)
Get configuration as singleton configuration resource and adapt it to the given class.
|
<T> @NotNull java.util.Collection<T> |
asAdaptableCollection(@NotNull java.lang.Class<T> clazz)
Get collection of configuration resources and adapt them to the given class.
|
<T> @NotNull java.util.Collection<T> |
asCollection(@NotNull java.lang.Class<T> clazz)
Get collection of configuration resources with their properties mapped to the given annotation class.
|
@NotNull ValueMap |
asValueMap()
Get configuration as singleton resource and return its properties as value map.
|
@NotNull java.util.Collection<ValueMap> |
asValueMapCollection()
Get collection of configuration resources with their properties mapped to the given annotation class.
|
<T> boolean |
has(@NotNull java.lang.Class<T> clazz)
This method checks for the configuration existence based on
configName defined in the configuration definition. |
boolean |
has(@NotNull java.lang.String configName)
This method checks for the configuration existence based on provided
configName value. |
@NotNull ConfigurationBuilder |
name(@NotNull java.lang.String configName)
Define configuration name.
|
@NotNull @NotNull ConfigurationBuilder name(@NotNull @NotNull java.lang.String configName)
as(Class)
, asCollection(Class)
and has(Class)
methods, mandatory for the others.configName
- Relative path@NotNull <T> T as(@NotNull @NotNull java.lang.Class<T> clazz)
name(String)
method it is derived
from the annotation interface class name.T
- Annotation class typeclazz
- Annotation interface class@NotNull <T> @NotNull java.util.Collection<T> asCollection(@NotNull @NotNull java.lang.Class<T> clazz)
name(String)
method it is derived
from the annotation interface class name.T
- Annotation class typeclazz
- Annotation interface class@NotNull @NotNull ValueMap asValueMap()
@NotNull @NotNull java.util.Collection<ValueMap> asValueMapCollection()
<T> T asAdaptable(@NotNull @NotNull java.lang.Class<T> clazz)
T
- Annotation class typeclazz
- Class that can be adapted from a Resource
@NotNull <T> @NotNull java.util.Collection<T> asAdaptableCollection(@NotNull @NotNull java.lang.Class<T> clazz)
T
- Annotation class typeclazz
- Class that can be adapted from a Resource
<T> boolean has(@NotNull @NotNull java.lang.Class<T> clazz)
configName
defined in the configuration definition. It extracts the configName
from the given annotation class and checks if the configuration is available for the context path in the current resource hierarchy. If not found, also
checks in the global fall-back paths configured via org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy
which by default are /conf/global
, /apps/config
and /libs/config
.This method does not consider the default values provided in
the configuration definition.T
- Annotation class typeclazz
- Class that can be adapted from a Resource
boolean has(@NotNull @NotNull java.lang.String configName)
configName
value.
It checks if the configuration is available for the context path in the current resource hierarchy and if not found, also
checks in the global fall-back paths configured via org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy
which by default are /conf/global
, /apps/config
and /libs/config
. This method does not consider the default values provided in
the configuration definition.configName
- Name of the configurationCopyright © 2022 The Apache Software Foundation. All rights reserved.