Class EnvVarHelper

java.lang.Object
com.helger.config.source.envvar.EnvVarHelper

@Immutable public final class EnvVarHelper extends Object
Helper functions for environment variables
Author:
Philip Helger
  • Field Details

    • DEFAULT_REPLACEMENT_CHAR

      public static final char DEFAULT_REPLACEMENT_CHAR
      See Also:
    • REPLACEMENT_CHAR_TO_SKIP

      public static final char REPLACEMENT_CHAR_TO_SKIP
      See Also:
  • Method Details

    • isValidFirstChar

      public static boolean isValidFirstChar(char c)
      Check if the provided character is a valid first character for an environment variable.
      Parameters:
      c - The character to check
      Returns:
      true if it is valid, false if not
    • isValidFollowingChar

      public static boolean isValidFollowingChar(char c)
      Check if the provided character is a valid second or following character for an environment variable.
      Parameters:
      c - The character to check
      Returns:
      true if it is valid, false if not
    • getUnifiedSysEnvName

      @Nonnull public static String getUnifiedSysEnvName(@Nonnull @Nonempty String sName, char cReplacement)
      Get a unified system environment variable name from the provided property name. This means uppercasing all characters and replacing invalid chars with a replacement character.
      Parameters:
      sName - The property name to convert. May neither be null nor empty.
      cReplacement - The character that should be used to replace invalid characters. See DEFAULT_REPLACEMENT_CHAR. If character `ยด is used, the invalid character is simply ignored. See REPLACEMENT_CHAR_TO_SKIP.
      Returns:
      The