owner icon indicating copy to clipboard operation
owner copied to clipboard

Converting `~` to java.nio.file.Path?

Open drapostolos opened this issue 8 years ago • 0 comments

Is there native Owner support to convert ~ to a Path object, similar to as for File? See code below.

Or do I need to create my own TypeConverter for this? Or could a TypeConverter for Path be added in a `owner-java7-extras´ module?

import java.nio.file.Path;

import org.aeonbits.owner.Config;
import org.aeonbits.owner.ConfigFactory;

public class Example {

    public static void main(String[] args) {

        WithPath conf = ConfigFactory.create(WithPath.class);
        System.out.println(conf.getPath());

    }

    public interface WithPath extends Config {
        @DefaultValue("~")
        Path getPath();
    }

}

drapostolos avatar Oct 17 '16 08:10 drapostolos