Package 

Interface KeyValueConfigurationContext

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Object getByStaticKey(K key) Target configuration rules might be defined as below:
      • Take current runtime value for key key1

      • If that value is equal to baseValue1 then use derivedValue1

      • If that value is equal to baseValue2 then use derivedValue2

      • Else use derivedValue3

      This method defines contract for obtaining base dynamic value for the given key from the given context.
      abstract Object getByDynamicKey(String key) We might have a finite state of possible keys (e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getByStaticKey

         abstract Object getByStaticKey(K key)

        Target configuration rules might be defined as below:

        • Take current runtime value for key key1

        • If that value is equal to baseValue1 then use derivedValue1

        • If that value is equal to baseValue2 then use derivedValue2

        • Else use derivedValue3

        This method defines contract for obtaining base dynamic value for the given key from the given context.

      • getByDynamicKey

         abstract Object getByDynamicKey(String key)

        We might have a finite state of possible keys (e.g. values of some enum) but want to allow flexible configuration based on some custom key as well.

        Example: suppose that target DataModificationStrategy is a result of database select, essentially a collection of column names to their row values. Keys set is finite here - all columns in that table. Let's assume that we want to modify value for particular column based on some meta-info. For example, use different values when we work with different database types (like oracle vs mysql). We can define such config rules as below:

        • If <db-type> = oracle then use oracleValue

        • If <db-type> = mysql then use mysqlValue

        • Else don't modify the value

        In this situation db-type is a custom dynamic key and target KeyValueConfigurationContext implementation should be aware of it