PriorityReader

An EnvReader that reads from multiple sources in order, returning the first value found.

This class is useful for creating a fallback mechanism for reading environment variables. For example, you could use a PriorityReader to first try reading from a .env file, and then fall back to reading from system properties.

Functions

Link copied to clipboard
open fun <T> read(key: String, targetType: Class<T>): Optional<T>
Reads an environment variable from the configured sources in order, returning the first value found.