Class ConfigInstanceUtil


  • public class ConfigInstanceUtil
    extends java.lang.Object
    Author:
    gjoranv
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object getField​(com.yahoo.config.ConfigBuilder builder, java.lang.String fieldName)
      Gets the value of a private field on a Builder.
      static <T extends com.yahoo.config.ConfigInstance>
      T
      getNewInstance​(java.lang.Class<T> type, java.lang.String configId, ConfigPayload payload)  
      static <BUILDER extends com.yahoo.config.ConfigBuilder>
      void
      setValues​(BUILDER destination, BUILDER source)
      Copies all values that have been explicitly set on the source to the destination.
      • Methods inherited from class java.lang.Object

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

      • ConfigInstanceUtil

        public ConfigInstanceUtil()
    • Method Detail

      • setValues

        public static <BUILDER extends com.yahoo.config.ConfigBuilder> void setValues​(BUILDER destination,
                                                                                      BUILDER source)
        Copies all values that have been explicitly set on the source to the destination. Values that have not been explicitly set in the source builder, will be left unchanged in the destination.
        Type Parameters:
        BUILDER - the builder class
        Parameters:
        destination - the builder to copy values into
        source - the builder to copy values from. Unset values are not copied
      • getNewInstance

        public static <T extends com.yahoo.config.ConfigInstance> T getNewInstance​(java.lang.Class<T> type,
                                                                                   java.lang.String configId,
                                                                                   ConfigPayload payload)
      • getField

        public static java.lang.Object getField​(com.yahoo.config.ConfigBuilder builder,
                                                java.lang.String fieldName)
        Gets the value of a private field on a Builder.
        Parameters:
        builder - a ConfigBuilder
        fieldName - a config field name
        Returns:
        the value of the private field