matteobaccan / owner

Get rid of the boilerplate code in properties based configuration.

Home Page:https://matteobaccan.github.io/owner/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple keys

maltalex opened this issue · comments

Hi @lviggiano

Thank you for your work on owner.

I have a situation in which a program needs to be able to run in two different environments, with one of the environments prefixing all of its environment variables with a prefix (e.g. FOO_). I'd like to be able to use the same owner file in both environments, but I don't see a straightforward way of doing that since it looks like PropertiesMapper maintains a single key -> value mapping per method. Is there a way to achieve something like that?

Thanks!

I think you can solve it with Variables expansion.
FYI: http://owner.aeonbits.org/docs/variables-expansion/
look at Variable expansion for the @Key part of documentation

@Gmugra
That's an interesting option, thanks.

If it helps to solve you problem, please close the issue.