Class Utils

java.lang.Object
org.qubership.atp.dataset.utils.Utils

public class Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • closeQuietly

      public static void closeQuietly(@Nullable Closeable closeable)
      Behaves like a apache IOUtils.
    • replacePlaceholders

      public static String replacePlaceholders(String in, Function<String,String> placeholderIntoValue)
      Replaces placeholder if needed.
      Parameters:
      placeholderIntoValue - invoked for each replace action (lazy). Converts placeholder text (without ${} symbols) into value.
    • replacePlaceholders

      public static String replacePlaceholders(Matcher matcher, Function<String,String> placeholderIntoValue)
      Replaces placeholder if needed.
      Parameters:
      matcher - with placeholders to replace.
      placeholderIntoValue - invoked for each replace action (lazy). Converts placeholder (with ${} symbols) into value.
    • doInstance

      public static <T> T doInstance(@Nonnull Class<T> targetClazz, @Nonnull String className, @Nullable String debugIdentifier)
      creates class instance.
      Type Parameters:
      T - type of class to be created
      Parameters:
      targetClazz - class to be returned
      className - of created instance (class name should be sublass of targetClazz or targetClazz itself)
      debugIdentifier - information for debug purposes
      Returns:
      new instance of requested class