Class PropertiesHelper

java.lang.Object
com.helger.base.rt.PropertiesHelper

@Immutable public final class PropertiesHelper extends Object
Helper class to ease the use of Properties class.
Author:
Philip Helger
  • Method Details

    • getAsStringMap

      @Nonnull @ReturnsMutableCopy public static Map<String,String> getAsStringMap(@Nonnull Properties aProps)
    • loadProperties

      @Nullable public static NonBlockingProperties loadProperties(@Nonnull @WillClose InputStream aIS)
    • loadProperties

      @Nullable public static NonBlockingProperties loadProperties(@Nonnull @WillClose Reader aReader)
    • expandSystemProperties

      @Nullable public static String expandSystemProperties(@Nullable String sValue)
      Copy of Oracle internal PropertyExpander.expand method
      Parameters:
      sValue - Source value. May be null.
      Returns:
      null if source is null.
      See Also:
    • expandProperties

      @Nullable public static String expandProperties(@Nullable String sValue, @Nonnull UnaryOperator<String> aValueProvider)
      Special version of expandSystemProperties(String) that takes an arbitrary value provider and is not limited to system properties.
      Parameters:
      sValue - Source value. May be null.
      aValueProvider - The value provider to be used. May not be null.
      Returns:
      null if the source value is null.
      Since:
      9.1.2