Search in sources :

Example 6 with NonNull

use of reactor.util.annotation.NonNull in project java-stellar-anchor-sdk by stellar.

the class CirclePaymentService method getCircleWallet.

/**
 * API request that retrieves the circle wallet with the given id.
 *
 * @param walletId is the existing wallet identifier.
 * @return asynchronous stream with the CircleWallet object.
 * @throws HttpException If the http response status code is 4xx or 5xx.
 */
@NonNull
private Mono<CircleWallet> getCircleWallet(String walletId) throws HttpException {
    return getWebClient(true).get().uri("/v1/wallets/" + walletId).responseSingle(handleResponseSingle()).map(body -> {
        Type type = new TypeToken<CircleDetailResponse<CircleWallet>>() {
        }.getType();
        CircleDetailResponse<CircleWallet> circleWalletResponse = gson.fromJson(body, type);
        return circleWalletResponse.getData();
    });
}
Also used : Type(java.lang.reflect.Type) NonNull(reactor.util.annotation.NonNull)

Example 7 with NonNull

use of reactor.util.annotation.NonNull in project rsocket-java by rsocket.

the class RequestChannelRequesterFlux method currentContext.

@Override
@NonNull
public Context currentContext() {
    long state = this.state;
    if (isSubscribedOrTerminated(state)) {
        Context cachedContext = this.cachedContext;
        if (cachedContext == null) {
            cachedContext = this.inboundSubscriber.currentContext().putAll((ContextView) DISCARD_CONTEXT);
            this.cachedContext = cachedContext;
        }
        return cachedContext;
    }
    return Context.empty();
}
Also used : Context(reactor.util.context.Context) ContextView(reactor.util.context.ContextView) NonNull(reactor.util.annotation.NonNull)

Aggregations

NonNull (reactor.util.annotation.NonNull)7 TimeUnit (java.util.concurrent.TimeUnit)3 Test (org.junit.jupiter.api.Test)3 AbstractExecutorService (java.util.concurrent.AbstractExecutorService)2 ExecutorService (java.util.concurrent.ExecutorService)2 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Type (java.lang.reflect.Type)1 InetSocketAddress (java.net.InetSocketAddress)1 URI (java.net.URI)1 URL (java.net.URL)1 Duration (java.time.Duration)1 LocalDateTime (java.time.LocalDateTime)1 DateTimeFormatter (java.time.format.DateTimeFormatter)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Optional (java.util.Optional)1