@Test public void asBoolean() { assertThat( propertyAccessor.asBoolean().get(BmcProperties.IN_MEMORY_READ_BUFFER), is(false)); this.configuration.setBoolean(BmcProperties.IN_MEMORY_READ_BUFFER.getPropertyName(), true); assertThat(propertyAccessor.asBoolean().get(BmcProperties.IN_MEMORY_READ_BUFFER), is(true)); this.configuration.setBoolean( BmcProperties.IN_MEMORY_READ_BUFFER.getPropertyName() + PROPERTY_OVERRIDE_SUFFIX, false); assertThat( propertyAccessor.asBoolean().get(BmcProperties.IN_MEMORY_READ_BUFFER), is(false)); }
Accessor<Boolean> asBoolean() { return new Accessor<Boolean>() { @Override public Boolean get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getBoolean(overriddenPropertyName, false); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getBoolean(property.getPropertyName(), false); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getBoolean(deprecatedKey, false); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Boolean) property.getDefaultValue(); } }; }
BmcPropertyAccessor { Accessor<Boolean> asBoolean() { return new Accessor<Boolean>() { @Override public Boolean get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getBoolean(overriddenPropertyName, false); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getBoolean(property.getPropertyName(), false); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getBoolean(deprecatedKey, false); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Boolean) property.getDefaultValue(); } }; } }
BmcPropertyAccessor { Accessor<Boolean> asBoolean() { return new Accessor<Boolean>() { @Override public Boolean get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getBoolean(overriddenPropertyName, false); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getBoolean(property.getPropertyName(), false); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getBoolean(deprecatedKey, false); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Boolean) property.getDefaultValue(); } }; }  }
BmcPropertyAccessor { Accessor<Boolean> asBoolean() { return new Accessor<Boolean>() { @Override public Boolean get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getBoolean(overriddenPropertyName, false); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getBoolean(property.getPropertyName(), false); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getBoolean(deprecatedKey, false); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Boolean) property.getDefaultValue(); } }; }   }
BmcPropertyAccessor { Accessor<Boolean> asBoolean() { return new Accessor<Boolean>() { @Override public Boolean get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getBoolean(overriddenPropertyName, false); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getBoolean(property.getPropertyName(), false); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getBoolean(deprecatedKey, false); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (Boolean) property.getDefaultValue(); } }; }    }