Package org.qubership.atp.dataset.utils
Class Utils
java.lang.Object
org.qubership.atp.dataset.utils.Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseQuietly(Closeable closeable) Behaves like a apache IOUtils.static <T> TdoInstance(Class<T> targetClazz, String className, String debugIdentifier) creates class instance.static StringreplacePlaceholders(String in, Function<String, String> placeholderIntoValue) Replaces placeholder if needed.static StringreplacePlaceholders(Matcher matcher, Function<String, String> placeholderIntoValue) Replaces placeholder if needed.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
closeQuietly
Behaves like a apache IOUtils. -
replacePlaceholders
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 returnedclassName- of created instance (class name should be sublass of targetClazz or targetClazz itself)debugIdentifier- information for debug purposes- Returns:
- new instance of requested class
-