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

Get wrong value which contains '%'

bingSea opened this issue · comments

commented

//db.properties

password=adc^9So%oTXP

//DbConfig.java

import org.aeonbits.owner.Config;
@Config.Sources({"classpath:config/db.properties"})
public interface DbConfig extends Config {
    String password();
}

//Demo.java

...
DbConfig config = ConfigFactory.create(DbConfig.class);
String pwd = config.password();
System.out.println(pwd );
...

this demo output : adc^9SonullTXP, not equals to adc^9So%oTXP

//Dependency

<!-- https://mvnrepository.com/artifact/org.aeonbits.owner/owner -->
<dependency>
	<groupId>org.aeonbits.owner</groupId>
	<artifactId>owner</artifactId>
	<version>1.0.9</version>
</dependency>

You can use @DisabledFeature annotation