@Test public void asString() { assertThat(propertyAccessor.asString().get(BmcProperties.HOST_NAME), nullValue()); this.configuration.set(BmcProperties.HOST_NAME.getPropertyName(), "value"); assertThat(propertyAccessor.asString().get(BmcProperties.HOST_NAME), is("value")); this.configuration.set( BmcProperties.HOST_NAME.getPropertyName() + PROPERTY_OVERRIDE_SUFFIX, "value2"); assertThat(propertyAccessor.asString().get(BmcProperties.HOST_NAME), is("value2")); }
Accessor<String> asString() { return new Accessor<String>() { @Override public String get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getTrimmed(overriddenPropertyName, null); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getTrimmed(property.getPropertyName(), null); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getTrimmed(deprecatedKey, null); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (String) property.getDefaultValue(); } }; }
BmcPropertyAccessor { Accessor<String> asString() { return new Accessor<String>() { @Override public String get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getTrimmed(overriddenPropertyName, null); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getTrimmed(property.getPropertyName(), null); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getTrimmed(deprecatedKey, null); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (String) property.getDefaultValue(); } }; } }
BmcPropertyAccessor { Accessor<String> asString() { return new Accessor<String>() { @Override public String get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getTrimmed(overriddenPropertyName, null); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getTrimmed(property.getPropertyName(), null); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getTrimmed(deprecatedKey, null); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (String) property.getDefaultValue(); } }; }  }
BmcPropertyAccessor { Accessor<String> asString() { return new Accessor<String>() { @Override public String get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getTrimmed(overriddenPropertyName, null); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getTrimmed(property.getPropertyName(), null); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getTrimmed(deprecatedKey, null); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (String) property.getDefaultValue(); } }; }   }
BmcPropertyAccessor { Accessor<String> asString() { return new Accessor<String>() { @Override public String get(BmcProperties property) { String overriddenPropertyName = getOverriddenPropertyName(property); if (exists(overriddenPropertyName)) { LOG.debug("Using key {}", overriddenPropertyName); return configuration.getTrimmed(overriddenPropertyName, null); } checkClash(property); if (exists(property.getPropertyName())) { LOG.debug("Using key {}", property.getPropertyName()); return configuration.getTrimmed(property.getPropertyName(), null); } String deprecatedKey = BmcConstants.Deprecated.getDeprecatedKey(property.getPropertyName()); if (exists(deprecatedKey)) { LOG.debug("Using key {}", deprecatedKey); return configuration.getTrimmed(deprecatedKey, null); } LOG.debug("No configuration found for {}", property.getPropertyName()); return (String) property.getDefaultValue(); } }; }    }