Interface Dotenv


public interface Dotenv
Creates and configures a new dotenv instance
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static class  Dotenv.Filter
    A dotenv entry filter
  • Method Summary

    Modifier and Type Method Description
    static DotenvBuilder configure()
    Configures a new Dotenv instance
    java.util.Set<DotenvEntry> entries()
    Returns the set of environment variables with values
    java.util.Set<DotenvEntry> entries​(Dotenv.Filter filter)
    Returns the set of Dotenv.Filters matching the the filter
    java.lang.String get​(java.lang.String key)
    Retrieves the value of the environment variable specified by key
    java.lang.String get​(java.lang.String key, java.lang.String defaultValue)
    Retrieves the value of the environment variable specified by key.
    static Dotenv load()
    Creates and loads a Dotenv instance with default options
  • Method Details

    • configure

      static DotenvBuilder configure()
      Configures a new Dotenv instance
      Returns:
      a new Dotenv instance
    • load

      static Dotenv load()
      Creates and loads a Dotenv instance with default options
      Returns:
      a new Dotenv instance
    • entries

      java.util.Set<DotenvEntry> entries()
      Returns the set of environment variables with values
      Returns:
      the set of DotenvEntrys for all environment variables
    • entries

      java.util.Set<DotenvEntry> entries​(Dotenv.Filter filter)
      Returns the set of Dotenv.Filters matching the the filter
      Parameters:
      filter - the filter e.g. Dotenv.Filter
      Returns:
      the set of DotenvEntrys for environment variables matching the Dotenv.Filter
    • get

      java.lang.String get​(java.lang.String key)
      Retrieves the value of the environment variable specified by key
      Parameters:
      key - the environment variable
      Returns:
      the value of the environment variable
    • get

      java.lang.String get​(java.lang.String key, java.lang.String defaultValue)
      Retrieves the value of the environment variable specified by key. If the environment variable specified by key does not exist, then the defaut value is returned
      Parameters:
      key - the environment variable
      defaultValue - the default value to return
      Returns:
      the value of the environment variable or default value