matteobaccan / owner

Get rid of the boilerplate code in properties based configuration.
https://matteobaccan.github.io/owner/
BSD 3-Clause "New" or "Revised" License
915 stars 212 forks source link

Get wrong value which contains '%' #288

Open bingSea opened 2 years ago

bingSea commented 2 years ago

//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>
vkazar commented 1 year ago

You can use @DisabledFeature annotation