@Test public void asInteger() { assertThat( propertyAccessor.asInteger().get(BmcProperties.READ_TIMEOUT_MILLIS), nullValue()); this.configuration.setInt(BmcProperties.READ_TIMEOUT_MILLIS.getPropertyName(), 25); assertThat(propertyAccessor.asInteger().get(BmcProperties.READ_TIMEOUT_MILLIS), is(25)); this.configuration.setInt( BmcProperties.READ_TIMEOUT_MILLIS.getPropertyName() + PROPERTY_OVERRIDE_SUFFIX, 50); assertThat(propertyAccessor.asInteger().get(BmcProperties.READ_TIMEOUT_MILLIS), is(50)); }
Accessor<Integer> asInteger() { return new Accessor<Integer>() { @Override public Integer get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getInt(overriddenPropertyName, 0); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getInt(property.getPropertyName(), 0); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getInt(deprecatedKey, 0); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Integer) property.getDefaultValue(); } }; }
BmcPropertyAccessor { Accessor<Integer> asInteger() { return new Accessor<Integer>() { @Override public Integer get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getInt(overriddenPropertyName, 0); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getInt(property.getPropertyName(), 0); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getInt(deprecatedKey, 0); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Integer) property.getDefaultValue(); } }; } }
BmcPropertyAccessor { Accessor<Integer> asInteger() { return new Accessor<Integer>() { @Override public Integer get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getInt(overriddenPropertyName, 0); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getInt(property.getPropertyName(), 0); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getInt(deprecatedKey, 0); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Integer) property.getDefaultValue(); } }; }  }
BmcPropertyAccessor { Accessor<Integer> asInteger() { return new Accessor<Integer>() { @Override public Integer get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getInt(overriddenPropertyName, 0); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getInt(property.getPropertyName(), 0); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getInt(deprecatedKey, 0); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Integer) property.getDefaultValue(); } }; }   }
BmcPropertyAccessor { Accessor<Integer> asInteger() { return new Accessor<Integer>() { @Override public Integer get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getInt(overriddenPropertyName, 0); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getInt(property.getPropertyName(), 0); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getInt(deprecatedKey, 0); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Integer) property.getDefaultValue(); } }; }    }