Open bingSea opened 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
adc^9SonullTXP
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
@DisabledFeature
//db.properties
//DbConfig.java
//Demo.java
this demo output :
adc^9SonullTXP
, not equals toadc^9So%oTXP
//Dependency