类的用途
java.lang.Void
使用 Void 的包
包
描述
提供对 Java 编程语言的设计至关重要的类。
HTTP 客户端和 WebSocket API
定义通道,它表示与能够执行 I/O 操作的实体的连接,例如文件和套接字;定义选择器,用于多路复用、非阻塞 I/O 操作。
通常在并发编程中有用的实用程序类。
提供开放数据类型和 Open MBean 描述符类。
-
Void 在 java.lang 中的用法
-
Void 在 java.net.http 中的用法
返回类型中包含 Void 类型参数的 java.net.http 中的方法修饰符和类型方法描述static HttpResponse.BodyHandler<Void>HttpResponse.BodyHandlers.discarding()返回丢弃响应主体的响应主体处理程序。static HttpResponse.BodySubscriber<Void>HttpResponse.BodySubscribers.discarding()返回丢弃响应正文的响应订阅者。static HttpResponse.BodyHandler<Void>HttpResponse.BodyHandlers.fromLineSubscriber(Flow.Subscriber<? super String> subscriber) 返回一个响应主体处理程序,该处理程序返回从BodySubscribers.fromLineSubscriber(subscriber, s -> null, charset, null)获得的BodySubscriber<Void>,具有给定的subscriber。static HttpResponse.BodySubscriber<Void>HttpResponse.BodySubscribers.fromLineSubscriber(Flow.Subscriber<? super String> subscriber) 返回一个正文订阅者,它将所有响应正文逐行转发到给定的Flow.Subscriber。static HttpResponse.BodyHandler<Void>HttpResponse.BodyHandlers.fromSubscriber(Flow.Subscriber<? super List<ByteBuffer>> subscriber) 返回一个响应主体处理程序,该处理程序返回从HttpResponse.BodySubscribers.fromSubscriber(Subscriber)获得的BodySubscriber<Void>,具有给定的subscriber。static HttpResponse.BodySubscriber<Void>HttpResponse.BodySubscribers.fromSubscriber(Flow.Subscriber<? super List<ByteBuffer>> subscriber) 返回将所有响应主体转发给给定Flow.Subscriber的主体订阅者。static HttpResponse.BodyHandler<Void>HttpResponse.BodyHandlers.ofByteArrayConsumer(Consumer<Optional<byte[]>> consumer) 返回一个BodyHandler<Void>,它返回一个从BodySubscribers.ofByteArrayConsumer(Consumer)获得的BodySubscriber<Void>。static HttpResponse.BodySubscriber<Void>HttpResponse.BodySubscribers.ofByteArrayConsumer(Consumer<Optional<byte[]>> consumer) 返回一个BodySubscriber,它将传入的正文数据提供给Optional<byte[]>的消费者。 -
Void 在 java.nio.channels 中的用法
返回类型中包含 Void 类型参数的 java.nio.channels 中的方法java.nio.channels 中的方法参数,类型参数为 Void修饰符和类型方法描述abstract <A> voidAsynchronousSocketChannel.connect(SocketAddress remote, A attachment, CompletionHandler<Void, ? super A> handler) 连接此通道。 -
Void 在 java.util.concurrent 中的用法
java.util.concurrent 中返回 Void 的方法返回类型中包含 Void 类型参数的 java.util.concurrent 中的方法修饰符和类型方法描述CompletableFuture.acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) CompletionStage.acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) 返回一个新的 CompletionStage,当这个或另一个给定阶段正常完成时,将以相应的结果作为提供的操作的参数执行。CompletableFuture.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) CompletableFuture.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) CompletionStage.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) 返回一个新的 CompletionStage,当这个或另一个给定阶段正常完成时,使用此阶段的默认异步执行工具执行,并将相应的结果作为提供的操作的参数。CompletionStage.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) 返回一个新的 CompletionStage,当这个或另一个给定阶段正常完成时,使用提供的执行器执行,并将相应的结果作为提供的操作的参数。static CompletableFuture<Void>CompletableFuture.allOf(CompletableFuture<?>... cfs) 返回一个新的 CompletableFuture,它在所有给定的 CompletableFutures 完成时完成。使用给定的 Consumer 函数处理所有已发布的项目。CompletableFuture.runAfterBoth(CompletionStage<?> other, Runnable action) CompletionStage.runAfterBoth(CompletionStage<?> other, Runnable action) 返回一个新的 CompletionStage,当这个阶段和另一个给定阶段都正常完成时,执行给定的操作。CompletableFuture.runAfterBothAsync(CompletionStage<?> other, Runnable action) CompletableFuture.runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) CompletionStage.runAfterBothAsync(CompletionStage<?> other, Runnable action) 返回一个新的 CompletionStage,当这个和另一个给定阶段都正常完成时,使用这个阶段的默认异步执行工具执行给定的操作。CompletionStage.runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) 返回一个新的 CompletionStage,当这个阶段和另一个给定阶段都正常完成时,使用提供的执行程序执行给定的操作。CompletableFuture.runAfterEither(CompletionStage<?> other, Runnable action) CompletionStage.runAfterEither(CompletionStage<?> other, Runnable action) 返回一个新的 CompletionStage,当这个或另一个给定阶段正常完成时,它会执行给定的操作。CompletableFuture.runAfterEitherAsync(CompletionStage<?> other, Runnable action) CompletableFuture.runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) CompletionStage.runAfterEitherAsync(CompletionStage<?> other, Runnable action) 返回一个新的 CompletionStage,当这个或另一个给定阶段正常完成时,使用这个阶段的默认异步执行工具执行给定的操作。CompletionStage.runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) 返回一个新的 CompletionStage,当这个或另一个给定阶段正常完成时,使用提供的执行程序执行给定的操作。static CompletableFuture<Void>返回一个新的 CompletableFuture,它在运行给定操作后由ForkJoinPool.commonPool()中运行的任务异步完成。static CompletableFuture<Void>返回一个新的 CompletableFuture,它在运行给定操作后由在给定执行器中运行的任务异步完成。CompletableFuture.thenAccept(Consumer<? super T> action) CompletionStage.thenAccept(Consumer<? super T> action) 返回一个新的 CompletionStage,当此阶段正常完成时,将使用此阶段的结果作为提供的操作的参数执行。CompletableFuture.thenAcceptAsync(Consumer<? super T> action) CompletableFuture.thenAcceptAsync(Consumer<? super T> action, Executor executor) CompletionStage.thenAcceptAsync(Consumer<? super T> action) 返回一个新的 CompletionStage,当这个阶段正常完成时,使用这个阶段的默认异步执行工具执行,这个阶段的结果作为提供的操作的参数。CompletionStage.thenAcceptAsync(Consumer<? super T> action, Executor executor) 返回一个新的 CompletionStage,当这个阶段正常完成时,使用提供的 Executor 执行,这个阶段的结果作为提供的操作的参数。<U> CompletableFuture<Void>CompletableFuture.thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> CompletionStage<Void>CompletionStage.thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) 返回一个新的 CompletionStage,当这个和另一个给定阶段都正常完成时,将执行两个结果作为提供的操作的参数。<U> CompletableFuture<Void>CompletableFuture.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> CompletableFuture<Void>CompletableFuture.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) <U> CompletionStage<Void>CompletionStage.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) 返回一个新的 CompletionStage,当这个和另一个给定阶段都正常完成时,使用这个阶段的默认异步执行工具执行,两个结果作为提供的操作的参数。<U> CompletionStage<Void>CompletionStage.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) 返回一个新的 CompletionStage,当这个和另一个给定阶段都正常完成时,使用提供的执行器执行,两个结果作为提供的操作的参数。返回一个新的 CompletionStage,当这个阶段正常完成时,它会执行给定的操作。CompletableFuture.thenRunAsync(Runnable action) CompletableFuture.thenRunAsync(Runnable action, Executor executor) CompletionStage.thenRunAsync(Runnable action) 返回一个新的 CompletionStage,当此阶段正常完成时,使用此阶段的默认异步执行工具执行给定的操作。CompletionStage.thenRunAsync(Runnable action, Executor executor) 返回一个新的 CompletionStage,当这个阶段正常完成时,使用提供的执行器执行给定的操作。java.util.concurrent 中的方法,参数类型为 Void -
Void 在 javax.management.openmbean 中的用法
javax.management.openmbean 中具有 Void 类型参数的字段修饰符和类型Field描述static final SimpleType<Void>SimpleType.VOIDSimpleType实例描述其 Java 类名为java.lang.Void的值。