Class MapConfigSource.MapBuilder<T extends MapConfigSource.MapBuilder<T>>

Type Parameters:
T - type of the implementing builder
All Implemented Interfaces:
Builder<MapConfigSource.Builder,MapConfigSource>, PollableSource.Builder<T>, Source.Builder<T>, Supplier<MapConfigSource>
Direct Known Subclasses:
ConfigSources.SystemPropertiesConfigSource.Builder, MapConfigSource.Builder
Enclosing class:
MapConfigSource

public abstract static class MapConfigSource.MapBuilder<T extends MapConfigSource.MapBuilder<T>> extends AbstractConfigSourceBuilder<T,Void> implements Builder<MapConfigSource.Builder,MapConfigSource>, PollableSource.Builder<T>
An abstract fluent API builder for MapConfigSource. If you want to extend MapConfigSource, you can use this class as a base for your own builder.
  • Constructor Details

    • MapBuilder

      protected MapBuilder()
      Creat a new builder instance.
  • Method Details

    • map

      public T map(Map<String,String> map)
      Map to be used as config source underlying data. The same instance is kept by the config source, to support polling.
      Parameters:
      map - map to use
      Returns:
      updated builder instance
    • properties

      public T properties(Properties properties)
      Properties to be used as config source underlying data. The same instance is kept by the config source, to support polling.
      Parameters:
      properties - properties to use
      Returns:
      updated builder instance
    • name

      public T name(String sourceName)
      Name of this source.
      Parameters:
      sourceName - name of this source
      Returns:
      updated builder instance
    • pollingStrategy

      public T pollingStrategy(PollingStrategy pollingStrategy)
      Description copied from class: AbstractSourceBuilder
      Configure a polling strategy. This method must be exposed by builders of sources that support polling. If you see this method as being protected in your builder, the source has removed support for polling, such as ClasspathConfigSource.
      Specified by:
      pollingStrategy in interface PollableSource.Builder<T extends MapConfigSource.MapBuilder<T>>
      Overrides:
      pollingStrategy in class AbstractSourceBuilder<T extends MapConfigSource.MapBuilder<T>,Void>
      Parameters:
      pollingStrategy - polling strategy to use
      Returns:
      updated builder instance
    • map

      protected Map<?,?> map()
      Map used as data of this config source.
      Returns:
      map with the data
    • sourceName

      protected String sourceName()
      Name of the source.
      Returns:
      name