Class MapBasedConfig

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<String,​Object>, org.eclipse.microprofile.config.Config

    public class MapBasedConfig
    extends LinkedHashMap<String,​Object>
    implements org.eclipse.microprofile.config.Config
    An implementation of Config based on a simple Map. This class is just use to mock real configuration, so should only be used for tests.

    Note that this implementation does not do any conversion, so you must pass the expected object instances.

    See Also:
    Serialized Form
    • Constructor Detail

      • MapBasedConfig

        public MapBasedConfig()
    • Method Detail

      • cleanup

        public static void cleanup()
      • getValue

        public <T> T getValue​(String propertyName,
                              Class<T> propertyType)
        Specified by:
        getValue in interface org.eclipse.microprofile.config.Config
      • getConfigValue

        public org.eclipse.microprofile.config.ConfigValue getConfigValue​(String propertyName)
        Specified by:
        getConfigValue in interface org.eclipse.microprofile.config.Config
      • getOptionalValue

        public <T> Optional<T> getOptionalValue​(String propertyName,
                                                Class<T> propertyType)
        Specified by:
        getOptionalValue in interface org.eclipse.microprofile.config.Config
      • getPropertyNames

        public Iterable<String> getPropertyNames()
        Specified by:
        getPropertyNames in interface org.eclipse.microprofile.config.Config
      • getConfigSources

        public Iterable<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSources()
        Specified by:
        getConfigSources in interface org.eclipse.microprofile.config.Config
      • getConverter

        public <T> Optional<org.eclipse.microprofile.config.spi.Converter<T>> getConverter​(Class<T> forType)
        Specified by:
        getConverter in interface org.eclipse.microprofile.config.Config
      • unwrap

        public <T> T unwrap​(Class<T> type)
        Specified by:
        unwrap in interface org.eclipse.microprofile.config.Config
      • write

        public void write()