Class VarUtil


  • public final class VarUtil
    extends java.lang.Object
    System and Environment variables utility class.
    See Also:
    System.getenv(String), System.getProperty(String)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Optional<java.lang.String> get​(@NonNull java.lang.String propertyNameAkaKey)
      Get variable from System and Environment variables by key.
      static java.util.Map<java.lang.String,​java.lang.String> getAll()
      Get all System and Environment variables.
      static java.lang.String getOrDefault​(@NonNull java.lang.String propertyNameAkaKey, java.lang.String defaultValue)
      Get variable from System and Environment variables by key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getAll

        public static java.util.Map<java.lang.String,​java.lang.String> getAll()
        Get all System and Environment variables.
        See Also:
        System.getenv(), System.getProperties()
      • get

        public static java.util.Optional<java.lang.String> get​(@NonNull
                                                               @NonNull java.lang.String propertyNameAkaKey)
        Get variable from System and Environment variables by key.
        See Also:
        System.getenv(String), System.getProperty(String)
      • getOrDefault

        @Nullable
        public static java.lang.String getOrDefault​(@NonNull
                                                    @NonNull java.lang.String propertyNameAkaKey,
                                                    @Nullable
                                                    java.lang.String defaultValue)
        Get variable from System and Environment variables by key.
        See Also:
        System.getenv(String), System.getProperty(String)