Interface TypedConfig<T>

Type Parameters:
T - the config type
All Known Implementing Classes:
AnnotationTypedConfig

@ProviderType public interface TypedConfig<T>
Represents a single config entry within a ConfigCollection. It has its own config type, which may be a annotation type or an interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <U> Stream<U>
    configStream(@NotNull Class<U> otherType)
    Returns a 0- or 1-element config stream (containing only this entry's config) depending on whether this entry's getType() matches the provided otherType.
    The config object.
    @NotNull Map<String,Object>
    Convert the config instance into a traditional config property map.
    @NotNull Class<T>
    The config type.
    default <U> Stream<TypedConfig<U>>
    stream(@NotNull Class<U> otherType)
    Returns a 0- or 1-element entry stream (containing only this entry) depending on whether this entry's getType() matches the provided otherType.
  • Method Details

    • getType

      @NotNull @NotNull Class<T> getType()
      The config type. This will only be an annotation type or an interface type.
      Returns:
      the config type
    • getConfig

      @NotNull T getConfig()
      The config object. This is the value that is expected to be passed to an Activate-annotated SCR component constructor.
      Returns:
      the config object
    • getConfigMap

      @NotNull @NotNull Map<String,Object> getConfigMap()
      Convert the config instance into a traditional config property map.
      Returns:
      a property map
    • stream

      default <U> Stream<TypedConfig<U>> stream(@NotNull @NotNull Class<U> otherType)
      Returns a 0- or 1-element entry stream (containing only this entry) depending on whether this entry's getType() matches the provided otherType. This is a convenience method for use in Stream.flatMap(Function) expressions on the containing ConfigCollection.stream().
      Type Parameters:
      U - the other type
      Parameters:
      otherType - the other type to filter by
      Returns:
      a 0- or 1-element entry stream (containing only this entry)
    • configStream

      default <U> Stream<U> configStream(@NotNull @NotNull Class<U> otherType)
      Returns a 0- or 1-element config stream (containing only this entry's config) depending on whether this entry's getType() matches the provided otherType. This is a convenience method for use in Stream.flatMap(Function) expressions on the containing ConfigCollection.stream().
      Type Parameters:
      U - the other type
      Parameters:
      otherType - the other type to filter by
      Returns:
      a 0- or 1-element config stream (containing only this entry's config)