public class VCacheCoreUtils extends Object
| Constructor and Description |
|---|
VCacheCoreUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> CompletionStage<T> |
failed(CompletionStage<T> result,
Throwable cause)
Returns a failed
CompletionStage with the specified cause. |
static <K> boolean |
isEmpty(Iterable<K> iter) |
static <V> byte[] |
marshall(V data,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling) |
static int |
roundUpToSeconds(Duration time) |
static <T> CompletionStage<T> |
successful(T value)
Returns a successfully completed
CompletionStage with the specified result. |
static <V> Optional<V> |
unmarshall(byte[] data,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling) |
static void |
whenPositive(long number,
LongConsumer handler) |
public static <T> CompletionStage<T> successful(T value)
CompletionStage with the specified result.T - the type of the resultvalue - the result for the futureCompletionStage with the specified result.public static <T> CompletionStage<T> failed(CompletionStage<T> result, Throwable cause)
CompletionStage with the specified cause.T - the type of the resultcause - the cause of the failureresult - A CompletionStage containing the result.CompletionStage with the specified cause.public static int roundUpToSeconds(Duration time)
public static void whenPositive(long number,
LongConsumer handler)
public static <V> byte[] marshall(V data,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling)
throws ExternalCacheException
ExternalCacheExceptionpublic static <V> Optional<V> unmarshall(@Nullable byte[] data, com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling) throws ExternalCacheException
ExternalCacheExceptionpublic static <K> boolean isEmpty(Iterable<K> iter)
Copyright © 2019 Atlassian. All rights reserved.