owner icon indicating copy to clipboard operation
owner copied to clipboard

How to globally set fully-qualified name

Open beatngu13 opened this issue 5 years ago • 2 comments

First of all: thx for this cool project! 🙏

AFAIK Owner defaults to the unqualified method name, i.e.:

package com.example;

import org.aeonbits.owner.Config;

public interface MyConfig extends Config {

    String myProperty();

}

Can be used as:

myProperty=foo

Is there a way to globally let Owner use the fully-qualified name, i.e.:

com.example.myProperty=foo

beatngu13 avatar Nov 28 '19 17:11 beatngu13

Hi.

The mapping used at the moment is very straightforward as you have noticed. The class who implements that is PropertiesMapper.java, and relies on @Key annotation then - if missing - on method name.

Would be definitely nice to have a feature to replace the default behavior with a different class; but it's not there; sorry.

Have a look at the class, maybe you can implement it by yourself, it should not be very hard. Eventually open a pull request; I cannot guarantee I'll be fast to review and integrate that, since I'm not working actively on this project. So, be lenient with me in this case.

Regards, Luigi.

lviggiano avatar Dec 04 '19 10:12 lviggiano

OK, thx for pointing to PropertiesMapper. Will have a look at it.

beatngu13 avatar Mar 09 '20 11:03 beatngu13