Class StoreOptions

java.lang.Object
me.ahoo.cosid.store.StoreOptions

public final class StoreOptions extends Object
The options of a store matched to the keys its provider declares (R1-spi-01, R1-spring-01): case, - and _ do not count, so an environment variable (..._OPTIONS_INITSCHEMA) and kebab-case (init-schema) reach initSchema; any other key is a problem. The runtime applies it to every store it opens; code that opens a store itself applies it too.
  • Method Details

    • canonical

      public static String canonical(String key)
      A key as it is compared: lower case, without - and _.
      Parameters:
      key - the key
      Returns:
      the compared form
    • resolve

      public static Map<String,Object> resolve(String store, StoreProvider provider, Map<String,Object> options)
      The options under the provider's spelling, or an error naming every unknown or repeated key.
      Parameters:
      store - the store name, for the error
      provider - the provider that opens the store
      options - the configured options
      Returns:
      the options keyed as StoreProvider.options() spells them
      Throws:
      IllegalArgumentException - if a key matches no declared option, or two keys match one
    • resolve

      public static Map<String,Object> resolve(String store, String type, Set<String> known, Map<String,Object> options, List<String> problems)
      The options under the provider's spelling, the problems collected for one message with others: what the runtime checks every store with. It keeps its signature (R2-core-03); a new parameter comes through a new method.
      Parameters:
      store - the store name, for the problems
      type - the store type
      known - the keys the provider declares
      options - the configured options
      problems - where an unknown or repeated key goes
      Returns:
      the options keyed by the declared spelling