Package com.clickhouse.client
Class ClickHouseDeferredValue<T>
- java.lang.Object
-
- com.clickhouse.client.ClickHouseDeferredValue<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Optional<T>getOptional()Gets optional value, which may or may not be null.static <T> ClickHouseDeferredValue<T>of(CompletableFuture<T> future)Wraps a future object.static <T> ClickHouseDeferredValue<T>of(CompletableFuture<T> future, int timeout)Wraps a future object.static <T> ClickHouseDeferredValue<T>of(Supplier<T> supplier)Wraps return value from a supplier function.static <T> ClickHouseDeferredValue<T>of(T value, Class<T> clazz)Wraps given value as a deferred value.
-
-
-
Method Detail
-
of
public static <T> ClickHouseDeferredValue<T> of(CompletableFuture<T> future)
Wraps a future object.- Type Parameters:
T- type of the value- Parameters:
future- future object, could be null- Returns:
- deferred value of a future object
-
of
public static <T> ClickHouseDeferredValue<T> of(CompletableFuture<T> future, int timeout)
Wraps a future object.- Type Parameters:
T- type of the value- Parameters:
future- future object, could be nulltimeout- timeout in milliseconds, zero or negative number means no timeout- Returns:
- deferred vaue of a future object
-
of
public static <T> ClickHouseDeferredValue<T> of(Supplier<T> supplier)
Wraps return value from a supplier function.- Type Parameters:
T- type of the value- Parameters:
supplier- supplier function, could be null- Returns:
- deferred value of return value from supplier function
-
of
public static <T> ClickHouseDeferredValue<T> of(T value, Class<T> clazz)
Wraps given value as a deferred value.- Type Parameters:
T- type of the value- Parameters:
value- value to wrapclazz- class of the value- Returns:
- deferred value
-
-