-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DI config binding API to facilitate configuration reuse #198
* optional DI configs
- Loading branch information
Showing
8 changed files
with
309 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
bootique/src/main/java/io/bootique/config/OptionRefWithConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,29 @@ | |||
package io.bootique.config; | |||
|
|||
import io.bootique.resource.ResourceFactory; | |||
|
|||
/** | |||
* @since 0.25 | |||
*/ | |||
public class OptionRefWithConfig { | |||
|
|||
private String optionName; | |||
private String configResourceId; | |||
|
|||
public OptionRefWithConfig(String optionName, String configResourceId) { | |||
this.optionName = optionName; | |||
this.configResourceId = configResourceId; | |||
} | |||
|
|||
public String getOptionName() { | |||
return optionName; | |||
} | |||
|
|||
public String getConfigResourceId() { | |||
return configResourceId; | |||
} | |||
|
|||
public ResourceFactory getConfigResource() { | |||
return new ResourceFactory(configResourceId); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.