Skip to content

Support subsets from a Config #981

@gastaldi

Description

@gastaldi

Because the Config interface has a nice way to convert values and handle optional values, it would be nice if the API allowed to extract a subset of a Config to pass it as a parameter to methods that don't care about the external structure:

Eg.

app.foo.username=guest
app.foo.password=guest
SmallRyeConfig config = ...
Config subset = config.subset("app.foo");
// Now I can call methods taking the config as a parameter that only cares about the leaf nodes:
configure(subset);

public void configure(Config subset) {
   String username = subset.getValue("username",String.class); // This would return "guest"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions