Package org.metricshub.ipmi.client
Class Utils
java.lang.Object
org.metricshub.ipmi.client.Utils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Texecute(AbstractIpmiRunner<T> callable, long timeout) Run the givenCallableusing the passed timeout in seconds.static StringgetValueOrEmpty(String value) static booleanstatic booleanstatic booleanisNotBlank(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 givenCallableusing the passed timeout in seconds.- Type Parameters:
T-- Parameters:
callable-timeout-- Returns:
Utilsresult returned by the callable- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-