Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a of(Class, Map) to ConfigProvider

  • Loading branch information...
commit 8d103f8cf7543895eda67fe529aff0657f182610 1 parent 7a91c8d
@stevenschlansker authored
View
2  pom.xml
@@ -17,7 +17,7 @@
<groupId>com.nesscomputing.components</groupId>
<artifactId>ness-config</artifactId>
<name>ness-config</name>
- <version>2.1.4-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Ness Configuration component.</description>
View
13 src/main/java/com/nesscomputing/config/ConfigProvider.java
@@ -77,6 +77,19 @@
return new ConfigProvider<TYPE>(prefix, clazz, overrides);
}
+ /**
+ * Returns a Provider for a configuration bean. This method should be used in Modules
+ * that require access to configuration.
+ * @param clazz The class of the Configuration bean.
+ * @return A provider.
+ * @see Config#getBean(String, Class)
+ */
+ public static final <TYPE> Provider<TYPE> of(final Class<TYPE> clazz,
+ @Nullable final Map<String, String> overrides)
+ {
+ return of(null, clazz, overrides);
+ }
+
private ConfigProvider(final String prefix, final Class<T> clazz, final Map<String, String> overrides)
{
this.prefix = prefix;
Please sign in to comment.
Something went wrong with that request. Please try again.