@Test public void getIntegerProperty() throws ComponentLookupException { Assert.assertEquals(42, this.mocker.getComponentUnderTest().<Integer>getProperty("an.integer", Integer.class) .intValue()); }
@SuppressWarnings("unchecked") @Override public <T> T getProperty(String key, T defaultValue) { String property = this.properties.getProperty(key); if (property == null) { return defaultValue; } if (defaultValue != null) { return getProperty(key, (Class<T>) defaultValue.getClass()); } else { return getProperty(key); } }
LegacyXWikiConfigurationSource implements ConfigurationSource, Initializable { @SuppressWarnings("unchecked") @Override public <T> T getProperty(String key, T defaultValue) { String property = this.properties.getProperty(key); if (property == null) { return defaultValue; } if (defaultValue != null) { return getProperty(key, (Class<T>) defaultValue.getClass()); } else { return getProperty(key); } } }
LegacyXWikiConfigurationSource implements ConfigurationSource, Initializable { @SuppressWarnings("unchecked") @Override public <T> T getProperty(String key, T defaultValue) { String property = this.properties.getProperty(key); if (property == null) { return defaultValue; } if (defaultValue != null) { return getProperty(key, (Class<T>) defaultValue.getClass()); } else { return getProperty(key); } }  }
LegacyXWikiConfigurationSource implements ConfigurationSource, Initializable { @SuppressWarnings("unchecked") @Override public <T> T getProperty(String key, T defaultValue) { String property = this.properties.getProperty(key); if (property == null) { return defaultValue; } if (defaultValue != null) { return getProperty(key, (Class<T>) defaultValue.getClass()); } else { return getProperty(key); } }  @Override void initialize(); @SuppressWarnings("unchecked") @Override T getProperty(String key, T defaultValue); @SuppressWarnings("unchecked") @Override T getProperty(String key, Class<T> valueClass); @SuppressWarnings("unchecked") @Override T getProperty(String key); @Override List<String> getKeys(); @Override boolean containsKey(String key); @Override boolean isEmpty(); }
LegacyXWikiConfigurationSource implements ConfigurationSource, Initializable { @SuppressWarnings("unchecked") @Override public <T> T getProperty(String key, T defaultValue) { String property = this.properties.getProperty(key); if (property == null) { return defaultValue; } if (defaultValue != null) { return getProperty(key, (Class<T>) defaultValue.getClass()); } else { return getProperty(key); } }  @Override void initialize(); @SuppressWarnings("unchecked") @Override T getProperty(String key, T defaultValue); @SuppressWarnings("unchecked") @Override T getProperty(String key, Class<T> valueClass); @SuppressWarnings("unchecked") @Override T getProperty(String key); @Override List<String> getKeys(); @Override boolean containsKey(String key); @Override boolean isEmpty();  }