Package org.metricshub.ipmi.client
Class Utils
java.lang.Object
org.metricshub.ipmi.client.Utils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
execute
(AbstractIpmiRunner<T> callable, long timeout) Run the givenCallable
using the passed timeout in seconds.static String
getValueOrEmpty
(String value) static boolean
static boolean
static boolean
isNotBlank
(String value)
-
Field Details
-
EMPTY
- See Also:
-
-
Method Details
-
isBlank
- Parameters:
value
- The value to check- Returns:
- whether the value is null, empty or contains only blank chars
-
isNotBlank
- Parameters:
value
- The value to check- Returns:
- whether the value is not null, nor empty nor contains only blank chars
-
isEmpty
- Parameters:
value
- The value to check- Returns:
- whether the value is empty of non-blank chars
- Throws:
NullPointerException
- if value is null
-
getValueOrEmpty
- Parameters:
value
- The value to return- Returns:
- the given value or empty string if the value is null or empty
-
execute
public static <T> T execute(AbstractIpmiRunner<T> callable, long timeout) throws InterruptedException, ExecutionException, TimeoutException Run the givenCallable
using the passed timeout in seconds.- Type Parameters:
T
-- Parameters:
callable
-timeout
-- Returns:
Utils
result returned by the callable- Throws:
InterruptedException
ExecutionException
TimeoutException
-