Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config methods with multiple @Keys and @DefaultValues #45

Open
lviggiano opened this issue Jul 21, 2013 · 0 comments
Open

Config methods with multiple @Keys and @DefaultValues #45

lviggiano opened this issue Jul 21, 2013 · 0 comments

Comments

@lviggiano
Copy link
Collaborator

At the moment, the @Key annotation only accept one value (as well the @DefaultValue annotation), it would be nice if for a single property we can specify multiple @Keys and multiple @DefaultValues.

Example

interface MyConfig extends Config {
    @Key({"db.driver", "db.url", "db.user", "db.password"})
    @DefaultValue({"org.h2.Driver", "jdbc:h2:~/.myapp/data", "scott", "tiger"})
    ConnectionPool connectionPool()
}

public class ConnectionPool {
    ConnectionPool(String driverClassName, String url, String user, String pwd) { ... }
    // or... better (see issue #44)  
    ConnectionPool(Class driver, String url, String user, String pwd) { ... }

    Connection getConnection() { ... }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant