Skip to content

alkedr/simple-property-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-property-loader

Maven Central Build Status

A simpler alternative to QATools properties-loader, OWNER and simular libraries.

Examples

All examples assume you have import static com.github.alkedr.SimplePropertyLoader.*;

Get optional String property
Optional<String> x = getOptionalSystemProperty("my.property");
Get non-optional String property (throws exception if property isn't set)
String x = getSystemProperty("my.property");
Get Long property
Long x = getSystemProperty("my.property", Long::valueOf);
Get property with default value
Optional<String> x = getOptionalSystemProperty("my.property").orElse("default value");
Get Long[] property (comma separated list of numbers)
Long[] x = getSystemProperty("my.property", Pattern.compile(",")::splitAsStream, Long::valueOf);
TODO: example: loading properties from file

About

Small and simple Java library for loading properties

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published