@Test public void asLong() { assertThat(propertyAccessor.asLong().get(BmcProperties.BLOCK_SIZE_IN_MB), is(32L)); this.configuration.setLong(BmcProperties.BLOCK_SIZE_IN_MB.getPropertyName(), 50L); assertThat(propertyAccessor.asLong().get(BmcProperties.BLOCK_SIZE_IN_MB), is(50L)); this.configuration.setLong( BmcProperties.BLOCK_SIZE_IN_MB.getPropertyName() + PROPERTY_OVERRIDE_SUFFIX, 100L); assertThat(propertyAccessor.asLong().get(BmcProperties.BLOCK_SIZE_IN_MB), is(100L)); }
Accessor<Long> asLong() { return new Accessor<Long>() { @Override public Long get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getLong(overriddenPropertyName, 0L); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getLong(property.getPropertyName(), 0L); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getLong(deprecatedKey, 0L); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Long) property.getDefaultValue(); } }; }
BmcPropertyAccessor { Accessor<Long> asLong() { return new Accessor<Long>() { @Override public Long get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getLong(overriddenPropertyName, 0L); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getLong(property.getPropertyName(), 0L); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getLong(deprecatedKey, 0L); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Long) property.getDefaultValue(); } }; } }
BmcPropertyAccessor { Accessor<Long> asLong() { return new Accessor<Long>() { @Override public Long get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getLong(overriddenPropertyName, 0L); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getLong(property.getPropertyName(), 0L); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getLong(deprecatedKey, 0L); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Long) property.getDefaultValue(); } }; }  }
BmcPropertyAccessor { Accessor<Long> asLong() { return new Accessor<Long>() { @Override public Long get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getLong(overriddenPropertyName, 0L); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getLong(property.getPropertyName(), 0L); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getLong(deprecatedKey, 0L); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Long) property.getDefaultValue(); } }; }   }
BmcPropertyAccessor { Accessor<Long> asLong() { return new Accessor<Long>() { @Override public Long get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getLong(overriddenPropertyName, 0L); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getLong(property.getPropertyName(), 0L); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getLong(deprecatedKey, 0L); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Long) property.getDefaultValue(); } }; }    }