Class Sources

java.lang.Object
com.github.mizool.core.configuration.Sources

public final class Sources extends Object
Factory for source instances.
  • Method Details

    • blank

      public static Source blank()
      Creates a source without any properties.
    • systemProperties

      public static Source systemProperties()
      Creates a source encapsulating access to the current system properties.
    • from

      public static Source from(Properties properties)
      Creates a source encapsulating access to the given Properties instance.
    • from

      public static Source from(Reader reader)
      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

      public static Source from(InputStream inputStream, Charset charset)
      Consumes the given input stream and returns a source encapsulating access to its properties.
      Parameters:
      inputStream - the input stream to load from
      charset - the charset to use
      Throws:
      UncheckedIOException - if reading failed
    • join

      public static Source join(Source primary, Source fallback)
      Creates a source that merges two sources. For keys present in both sources, the ones from primary take precedence.