Class AbstractMapConfigurationValueProvider

    • Constructor Detail

      • AbstractMapConfigurationValueProvider

        public AbstractMapConfigurationValueProvider()
    • Method Detail

      • getMap

        protected abstract Map<?,​?> getMap()
      • getSourceDescription

        protected abstract String getSourceDescription()
      • getProvidedValue

        public ProvidedValue getProvidedValue​(String... keyAndAliases)
        Default implementation stores a cache of found known values, falling back to lookupProvidedValue(String...) when it is asked about a new key. Uses getMapHash() to determine if the underlying map has changed.
        Parameters:
        keyAndAliases - an array of keys to check, where the first element is the canonical key name, any aliases for that key as later elements.
        Returns:
        null if the key is not defined in this provider.
      • getMapHash

        protected int getMapHash()
        Used by getProvidedValue(String...) to determine if the underlying data has changed vs. the cached results.
      • keyMatches

        protected boolean keyMatches​(String wantedKey,
                                     String storedKey)
        Used by ConfigurationValueProvider.getProvidedValue(String[]) to determine of a given map entry matches the wanted key. This implementation compares the values case-insensitively, and will replace camelCase words with kabob-case
        Parameters:
        wantedKey - the configuration key requested
        storedKey - the key stored in the map