Interface ConfigCollection
-
@ProviderType public interface ConfigCollection
A heterogeneously typed collection of OSGi Config objects for injection as a test parameter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Stream<T>
configStream(@NotNull Class<T> configType)
Return a typed stream of only those configs in the collection that match the desired config type.default <T> T
firstConfig(@NotNull Class<T> configType)
Return the first available config of type configType, or throw if none are available.default <T> Map<String,Object>
firstConfigMap(@NotNull Class<T> configType)
Return the first available config of type configType as aMap
, or throw if none are available.Stream<TypedConfig>
stream()
Return an untyped stream of all the typed configs contained in this collection.default <T> Stream<TypedConfig<T>>
stream(@NotNull Class<T> configType)
Return a typed stream of only those entries in the collection that match the desired config type.
-
-
-
Method Detail
-
stream
Stream<TypedConfig> stream()
Return an untyped stream of all the typed configs contained in this collection.- Returns:
- an untyped stream of typed configs
-
stream
default <T> Stream<TypedConfig<T>> stream(@NotNull @NotNull Class<T> configType)
Return a typed stream of only those entries in the collection that match the desired config type.- Type Parameters:
T
- the config type- Parameters:
configType
- the desired config type- Returns:
- a typed stream of typed configs
-
configStream
default <T> Stream<T> configStream(@NotNull @NotNull Class<T> configType)
Return a typed stream of only those configs in the collection that match the desired config type.- Type Parameters:
T
- the config type- Parameters:
configType
- the desired config type- Returns:
- a typed stream of config values
-
firstConfig
default <T> T firstConfig(@NotNull @NotNull Class<T> configType)
Return the first available config of type configType, or throw if none are available.- Type Parameters:
T
- the config type- Parameters:
configType
- the desired configType- Returns:
- the first available config value
- Throws:
NoSuchElementException
- if no matching config is available
-
firstConfigMap
default <T> Map<String,Object> firstConfigMap(@NotNull @NotNull Class<T> configType)
Return the first available config of type configType as aMap
, or throw if none are available.- Type Parameters:
T
- the config type- Parameters:
configType
- the desired configType- Returns:
- the first available config value as a map
- Throws:
NoSuchElementException
- if no matching config is available
-
-