@Test public void testStaticNameBinding() { Settings settings = Settings.builder() .addFromClassPath("com/chillenious/common/util/p1.properties") .build(); Bootstrap bootstrap = new Bootstrap(settings); SomeClassUsingStaticNameBinding o = bootstrap.getInjector().getInstance(SomeClassUsingStaticNameBinding.class); Assert.assertEquals("fender", o.guitar); }
public static SettingsBuilder builder() { return new SettingsBuilder(new Settings()); }
Settings implements Serializable { public static SettingsBuilder builder() { return new SettingsBuilder(new Settings()); } }
Settings implements Serializable { public static SettingsBuilder builder() { return new SettingsBuilder(new Settings()); } Settings(); }
Settings implements Serializable { public static SettingsBuilder builder() { return new SettingsBuilder(new Settings()); } Settings(); synchronized void loadFromClassPath(String location); synchronized void loadFromProperties(Properties p); synchronized void loadFromFile(String location); Object set(String source, String setting, @Nullable String value); Object set(String setting, @Nullable String value); static KeyIteratorFilter startsWith(String prefix); static KeyIteratorFilter endsWith(String prefix); static KeyIteratorFilter contains(String string); static KeyIteratorFilter notContains(String string); static KeyIteratorFilter matches(String regex); static KeyIteratorFilter[] join(KeyIteratorFilter filter,
                                           KeyIteratorFilter... filters); Keys keys(); Keys keys(@Nullable KeyIteratorFilter... filter); MappedSettings<T> map(@Nullable String prefix, Class<T> type); MappedSettings<T> map(@Nullable String prefix,
                                     Class<T> type,
                                     KeyIteratorFilter... filters); boolean isDefined(String key); @Nullable String getString(String key); @Nullable Integer getInteger(String key); @Nullable Long getLong(String key); @Nullable Double getDouble(String key); Boolean getBoolean(String key); @Nullable BigDecimal getBigDecimal(String key); String getString(String key, String defaultValue); Long getLong(String key, @Nullable Long defaultValue); Integer getInteger(String key, @Nullable Integer defaultValue); Double getDouble(String key, @Nullable Double defaultValue); @Nullable BigDecimal getBigDecimal(String key, @Nullable BigDecimal defaultValue); Boolean getBoolean(String key, @Nullable Boolean defaultValue); Properties asProperties(); Properties asProperties(@Nullable String prefixForCutoff); Map<String, String> asMap(); Map<String, String> asMap(@Nullable String prefixForCutoff); synchronized List<String> getLocationsLoaded(); void addListener(SettingsListener l); void removeListener(SettingsListener l); @Override String toString(); static SettingsBuilder builder(); }
Settings implements Serializable { public static SettingsBuilder builder() { return new SettingsBuilder(new Settings()); } Settings(); synchronized void loadFromClassPath(String location); synchronized void loadFromProperties(Properties p); synchronized void loadFromFile(String location); Object set(String source, String setting, @Nullable String value); Object set(String setting, @Nullable String value); static KeyIteratorFilter startsWith(String prefix); static KeyIteratorFilter endsWith(String prefix); static KeyIteratorFilter contains(String string); static KeyIteratorFilter notContains(String string); static KeyIteratorFilter matches(String regex); static KeyIteratorFilter[] join(KeyIteratorFilter filter,
                                           KeyIteratorFilter... filters); Keys keys(); Keys keys(@Nullable KeyIteratorFilter... filter); MappedSettings<T> map(@Nullable String prefix, Class<T> type); MappedSettings<T> map(@Nullable String prefix,
                                     Class<T> type,
                                     KeyIteratorFilter... filters); boolean isDefined(String key); @Nullable String getString(String key); @Nullable Integer getInteger(String key); @Nullable Long getLong(String key); @Nullable Double getDouble(String key); Boolean getBoolean(String key); @Nullable BigDecimal getBigDecimal(String key); String getString(String key, String defaultValue); Long getLong(String key, @Nullable Long defaultValue); Integer getInteger(String key, @Nullable Integer defaultValue); Double getDouble(String key, @Nullable Double defaultValue); @Nullable BigDecimal getBigDecimal(String key, @Nullable BigDecimal defaultValue); Boolean getBoolean(String key, @Nullable Boolean defaultValue); Properties asProperties(); Properties asProperties(@Nullable String prefixForCutoff); Map<String, String> asMap(); Map<String, String> asMap(@Nullable String prefixForCutoff); synchronized List<String> getLocationsLoaded(); void addListener(SettingsListener l); void removeListener(SettingsListener l); @Override String toString(); static SettingsBuilder builder(); static final String OVERRIDES_FILE_SYSTEM_PROPERTY; }