Skip to content

Nested configuration interfaces #129

@jiri-neuman

Description

@jiri-neuman

Hi, I've just came across your project and I really like it. I'd like to use it in our project and I have one question. Is it possible to create a configuration interface with additional nested interfaces.

An example of the idea:

public interface AppConfig {
    DatabaseConfig db();
}

public interface DatabaseConfig {

    String url();

    String user();

    String password();
}

And the corresponding properties configuration:

db.url=localhost
db.user=admin
db.password=pass

I would expect to pass the AppConfig to the ConfigFactory.create() and get the whole structure populated, including the nested interface. In the current version (1.0.8) this does not seem to work. Am I doing something wrong or is this not supported? Do you think it makes sense to implement this in a future version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions