EnvBinder
Binds environment variables to an instance of a class.
This class uses an EnvReader to read environment variables and populate the fields of a given class. It supports both classes with public fields and classes with private fields and setters.
Example of usage:
public class Config {
private String host;
private int port;
// Getters...
}
EnvBinder binder = new EnvBinder(EnvReader.defaultReader());
Config config = binder.bind(Config.class);
Content copied to clipboard