Library designed for retrieving properties set at application startup. If you don't use Spring Framework/Spring Boot but like its configuration via yaml - you will find this library useful.
- Lightweight, no need to pull lots of dependencies
- No reflection and typecasts
- Null safe and runtime exception free
This library is distributed via jitpack.io
- Properties passed via -D
- Environment variables
- Json strings
Note that using json entries requires additional dependencies:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>1.1.6</version>
</dependency>- Yaml files
Note that using yaml entries requires additional dependencies:
<dependency>
<groupId>com.amihaiemil.web</groupId>
<artifactId>eo-yaml</artifactId>
<version>8.0.6</version>
</dependency>String prop=new EProp("your_prop_passed_via_-D").value();String env=new EEnv("my_env").value()TODO add docs
- Works similar to spring framework @Value
- Supports string, number, arrays, float, boolean as value
- Supports default values and env injections
- Default yaml file config is placed under "src/main/resources/application.yaml", but is configurable
sex: "male"
person:
name: "kekus"
languages: [ ru,en ]
age: ${AGE_ENV:123}String sex=new EVal("sex").value();String name=new EVal("person.name").value();List<String> languages=new ESplit(new EVal("person.languages")).value();String age=new EVal("person.age").value();- If there is a default value and env is not present - will return default value
- If there is a default value and env is present - will return value from env
- If default value is not present - will return value from env