- java.lang.Object
-
- com.github.mizosoft.methanol.internal.cache.RawResponse
-
- com.github.mizosoft.methanol.internal.cache.NetworkResponse
-
public final class NetworkResponse extends RawResponse
ARawResponsethat came from the network and may be written to cache.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddiscard(java.util.concurrent.Executor executor)Discards the response body in background.<T> java.util.concurrent.CompletableFuture<TrackedResponse<T>>handleAsync(java.net.http.HttpResponse.BodyHandler<T> handler, java.util.concurrent.Executor executor)booleanisCacheUpdating()static NetworkResponseof(TrackedResponse<java.util.concurrent.Flow.Publisher<java.util.List<java.nio.ByteBuffer>>> response)NetworkResponsewith(java.util.function.Consumer<ResponseBuilder<?>> mutator)NetworkResponsewritingWith(Store.Editor editor, java.util.concurrent.Executor executor, CacheWritingPublisher.Listener writeListener, boolean synchronizeWrites)-
Methods inherited from class com.github.mizosoft.methanol.internal.cache.RawResponse
get, handle, toString
-
-
-
-
Method Detail
-
writingWith
public NetworkResponse writingWith(Store.Editor editor, java.util.concurrent.Executor executor, CacheWritingPublisher.Listener writeListener, boolean synchronizeWrites)
-
discard
public void discard(java.util.concurrent.Executor executor)
Discards the response body in background.
-
isCacheUpdating
public boolean isCacheUpdating()
-
with
public NetworkResponse with(java.util.function.Consumer<ResponseBuilder<?>> mutator)
- Specified by:
within classRawResponse
-
of
public static NetworkResponse of(TrackedResponse<java.util.concurrent.Flow.Publisher<java.util.List<java.nio.ByteBuffer>>> response)
-
handleAsync
public <T> java.util.concurrent.CompletableFuture<TrackedResponse<T>> handleAsync(java.net.http.HttpResponse.BodyHandler<T> handler, java.util.concurrent.Executor executor)
- Specified by:
handleAsyncin classRawResponse
-
-