Class SettingsBuilder<T>

  • All Implemented Interfaces:
    com.google.inject.Provider<Settings<T>>, javax.inject.Provider<Settings<T>>

    public class SettingsBuilder<T>
    extends Object
    implements com.google.inject.Provider<Settings<T>>
    Binds the parameterized configuration values described in annotations on enums to the configuration values found in the supplied type safe config.
    Since:
    4.0.0
    Author:
    erlend
    • Method Detail

      • with

        public static <T> SettingsBuilder<T> with​(com.google.inject.Binder binder,
                                                  Class<T> cls)
        Binds the annotations of the supplied configuration enum as guice names with the values obtained from typesafe config.
        Type Parameters:
        T - the type literal of the enum for instance PersisterConf
        Parameters:
        binder - current Guice binder
        cls - the enum class with annotations
        Returns:
        instance of SettingsBuilder
      • setConfig

        @Inject
        public void setConfig​(com.typesafe.config.Config config)
      • get

        public Settings<T> get()
        Specified by:
        get in interface com.google.inject.Provider<T>
        Specified by:
        get in interface javax.inject.Provider<T>