Example usage for org.springframework.boot.context.properties.source ConfigurationPropertyNameAliases addAliases

List of usage examples for org.springframework.boot.context.properties.source ConfigurationPropertyNameAliases addAliases

Introduction

In this page you can find the example usage for org.springframework.boot.context.properties.source ConfigurationPropertyNameAliases addAliases.

Prototype

public void addAliases(ConfigurationPropertyName name, ConfigurationPropertyName... aliases) 

Source Link

Usage

From source file:org.springframework.boot.jdbc.DataSourceBuilder.java

private void bind(DataSource result) {
    ConfigurationPropertySource source = new MapConfigurationPropertySource(this.properties);
    ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases();
    aliases.addAliases("url", "jdbc-url");
    aliases.addAliases("username", "user");
    Binder binder = new Binder(source.withAliases(aliases));
    binder.bind(ConfigurationPropertyName.EMPTY, Bindable.ofInstance(result));
}