Package com.couchbase.client.java
Enum AsyncUtils
- java.lang.Object
-
- java.lang.Enum<AsyncUtils>
-
- com.couchbase.client.java.AsyncUtils
-
- All Implemented Interfaces:
Serializable
,Comparable<AsyncUtils>
public enum AsyncUtils extends Enum<AsyncUtils>
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
block(CompletableFuture<T> input)
Helper method to wrap an async call into a blocking one and make sure to convert all checked exceptions into their correct runtime counterparts.static AsyncUtils
valueOf(String name)
Returns the enum constant of this type with the specified name.static AsyncUtils[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static AsyncUtils[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AsyncUtils c : AsyncUtils.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AsyncUtils valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
block
public static <T> T block(CompletableFuture<T> input)
Helper method to wrap an async call into a blocking one and make sure to convert all checked exceptions into their correct runtime counterparts.- Type Parameters:
T
- the generic type to return.- Parameters:
input
- the future as input.- Returns:
- blocks and completes on the given future while converting checked exceptions.
-
-