Package de.hshannover.dqgui.core
Class Utility
- java.lang.Object
-
- de.hshannover.dqgui.core.Utility
-
public final class Utility extends java.lang.ObjectUtility class. Add globally referenced Utility methods here.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteFolderRecursively(java.nio.file.Path p)static java.lang.StringformatHost(java.lang.String host)static java.lang.StringhumanReadableFormat(java.time.Duration duration)Convert a duration into a format like this 5m1s.static java.util.Optional<java.lang.Integer>integer(java.lang.String s)static voidkillChildProcessTree()Kills everything attached to this process.static java.lang.Stringordinal(int i)static voidprepareFilesystemProject(Project prj)static voidrequireNonNull(java.lang.Object... objects)static java.lang.StringtoString(java.lang.Object obj)static <T> TuncheckCall(java.util.concurrent.Callable<T> callable)Convert call with checked exception to unchecked exception.
Useful in streams.
-
-
-
Method Detail
-
formatHost
public static java.lang.String formatHost(java.lang.String host)
-
toString
public static java.lang.String toString(java.lang.Object obj)
-
requireNonNull
public static void requireNonNull(java.lang.Object... objects)
-
integer
public static java.util.Optional<java.lang.Integer> integer(java.lang.String s)
-
ordinal
public static java.lang.String ordinal(int i)
-
prepareFilesystemProject
public static void prepareFilesystemProject(Project prj) throws java.lang.Exception
- Throws:
java.lang.Exception
-
uncheckCall
public static <T> T uncheckCall(java.util.concurrent.Callable<T> callable)
Convert call with checked exception to unchecked exception.
Useful in streams.- Type Parameters:
T- type of call- Parameters:
callable- to convert- Returns:
- callable result
-
humanReadableFormat
public static java.lang.String humanReadableFormat(java.time.Duration duration)
Convert a duration into a format like this 5m1s.- Parameters:
duration- to convert- Returns:
- human readable format
-
killChildProcessTree
public static void killChildProcessTree()
Kills everything attached to this process.
-
deleteFolderRecursively
public static void deleteFolderRecursively(java.nio.file.Path p) throws java.io.IOException- Throws:
java.io.IOException
-
-