Class Sources
java.lang.Object
com.github.mizool.core.configuration.Sources
Factory for source instances.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Sourceblank()Creates a source without any properties.static Sourcefrom(InputStream inputStream, Charset charset) Consumes the given input stream and returns a source encapsulating access to its properties.static SourceConsumes the given reader and returns a source encapsulating access to its properties.static Sourcefrom(Properties properties) Creates a source encapsulating access to the givenPropertiesinstance.static SourceCreates a source that merges two sources.static SourceCreates a source encapsulating access to the current system properties.
-
Method Details
-
blank
Creates a source without any properties. -
systemProperties
Creates a source encapsulating access to the current system properties. -
from
Creates a source encapsulating access to the givenPropertiesinstance. -
from
Consumes the given reader and returns a source encapsulating access to its properties.- Parameters:
reader- the reader to load from- Throws:
UncheckedIOException- if reading failed
-
from
Consumes the given input stream and returns a source encapsulating access to its properties.- Parameters:
inputStream- the input stream to load fromcharset- the charset to use- Throws:
UncheckedIOException- if reading failed
-
join
Creates a source that merges two sources. For keys present in both sources, the ones fromprimarytake precedence.
-