Interface ConfigCollection
@ProviderType
public interface ConfigCollection
A heterogeneously typed collection of OSGi Config objects for injection as a test parameter.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <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.firstConfigMap
(@NotNull Class<T> configType) Return the first available config of type configType as aMap
, or throw if none are available.stream()
Return an untyped stream of all the typed configs contained in this collection.default <T> Stream<TypedConfig<T>>
Return a typed stream of only those entries in the collection that match the desired config type.
-
Method Details
-
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
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
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
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
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
-