Uses of Interface
java.util.function.Supplier
-
Packages that use Supplier 软件包 描述 java.lang 提供对Java编程语言设计至关重要的类。java.lang.module 通过解析和服务绑定来支持模块描述符和创建模块配置的类。java.net.http HTTP客户端和WebSocket APIjava.util 包含集合框架,一些国际化支持类,服务加载器,属性,随机数生成,字符串解析和扫描类,base64编码和解码,位数组和几个其他实用程序类。java.util.concurrent 实用类通常在并发编程中有用。java.util.logging 提供Javaâ“2平台核心日志记录工具的类和接口。java.util.stream 用于支持元素流上的功能样式操作的类,例如集合上的map-reduce转换。jdk.dynalink.linker 包含语言运行时所需的接口和类,以实现其自己的语言特定对象模型和类型转换。jdk.jshell 提供用于创建工具的接口,例如读取 - 评估 - 打印循环(REPL),其交互式地评估Java编程语言代码的“片段”。 -
-
Uses of Supplier in java.lang
Methods in java.lang with parameters of type Supplier 变量和类型 方法 描述 default voidSystem.Logger. log(System.Logger.Level level, Supplier<String> msgSupplier)记录延迟提供的消息。default voidSystem.Logger. log(System.Logger.Level level, Supplier<String> msgSupplier, Throwable thrown)记录与给定throwable关联的延迟提供的消息。static <S> ThreadLocal<S>ThreadLocal. withInitial(Supplier<? extends S> supplier)创建一个线程局部变量。 -
Uses of Supplier in java.lang.module
Methods in java.lang.module with parameters of type Supplier 变量和类型 方法 描述 static ModuleDescriptorModuleDescriptor. read(InputStream in, Supplier<Set<String>> packageFinder)从输入流中读取模块声明的二进制形式作为模块描述符。static ModuleDescriptorModuleDescriptor. read(ByteBuffer bb, Supplier<Set<String>> packageFinder)从字节缓冲区中读取模块声明的二进制形式作为模块描述符。 -
Uses of Supplier in java.net.http
Methods in java.net.http with parameters of type Supplier 变量和类型 方法 描述 static HttpRequest.BodyPublisherHttpRequest.BodyPublishers. ofInputStream(Supplier<? extends InputStream> streamSupplier)请求正文发布者,从InputStream读取其数据。 -
Uses of Supplier in java.util
Subinterfaces of Supplier in java.util 变量和类型 接口 描述 static interfaceServiceLoader.Provider<S>表示位于ServiceLoader的服务提供商。Methods in java.util with parameters of type Supplier 变量和类型 方法 描述 Optional<T>Optional. or(Supplier<? extends Optional<? extends T>> supplier)如果值存在时,返回一个Optional描述的值,否则返回一个Optional通过供给函数产生。TOptional. orElseGet(Supplier<? extends T> supplier)如果存在值,则返回该值,否则返回由供应函数生成的结果。<X extends Throwable>
TOptional. orElseThrow(Supplier<? extends X> exceptionSupplier)如果存在值,则返回该值,否则抛出异常提供函数生成的异常。<X extends Throwable>
doubleOptionalDouble. orElseThrow(Supplier<? extends X> exceptionSupplier)如果存在值,则返回该值,否则抛出异常提供函数生成的异常。<X extends Throwable>
intOptionalInt. orElseThrow(Supplier<? extends X> exceptionSupplier)如果存在值,则返回该值,否则抛出异常提供函数生成的异常。<X extends Throwable>
longOptionalLong. orElseThrow(Supplier<? extends X> exceptionSupplier)如果存在值,则返回该值,否则抛出异常提供函数生成的异常。static <T> TObjects. requireNonNull(T obj, Supplier<String> messageSupplier)检查指定的对象引用是否为null,如果是,则抛出自定义的NullPointerException。static <T> TObjects. requireNonNullElseGet(T obj, Supplier<? extends T> supplier)如果它是非null,则返回第一个参数,否则返回非null值supplier.get()。 -
Uses of Supplier in java.util.concurrent
Methods in java.util.concurrent with parameters of type Supplier 变量和类型 方法 描述 CompletableFuture<T>CompletableFuture. completeAsync(Supplier<? extends T> supplier)使用默认执行程序从异步任务调用给定的Supplier函数的结果,完成此CompletableFuture。CompletableFuture<T>CompletableFuture. completeAsync(Supplier<? extends T> supplier, Executor executor)使用给定执行程序从异步任务调用给定的Supplier函数的结果完成此CompletableFuture。static <U> CompletableFuture<U>CompletableFuture. supplyAsync(Supplier<U> supplier)返回由ForkJoinPool.commonPool()中运行的任务异步完成的新CompletableFuture, 其中包含通过调用给定供应商获得的值。static <U> CompletableFuture<U>CompletableFuture. supplyAsync(Supplier<U> supplier, Executor executor)返回由给定执行程序中运行的任务异步完成的新CompletableFuture,其中包含通过调用给定供应商获得的值。 -
Uses of Supplier in java.util.logging
Methods in java.util.logging with parameters of type Supplier 变量和类型 方法 描述 voidLogger. config(Supplier<String> msgSupplier)记录CONFIG消息,只有在日志记录级别实际记录消息时才构造。voidLogger. fine(Supplier<String> msgSupplier)记录一条FINE消息,该消息仅在日志记录级别实际记录消息时才构建。voidLogger. finer(Supplier<String> msgSupplier)记录FINER消息,该消息仅在日志记录级别实际记录消息时才构建。voidLogger. finest(Supplier<String> msgSupplier)记录FINEST消息,该消息仅在日志记录级别实际记录消息时才构建。voidLogger. info(Supplier<String> msgSupplier)记录一条INFO消息,该消息仅在日志记录级别实际记录消息时才构建。voidLogger. log(Level level, Throwable thrown, Supplier<String> msgSupplier)使用关联的Throwable信息记录延迟构造的消息。voidLogger. log(Level level, Supplier<String> msgSupplier)记录消息,只有在日志记录级别实际记录消息时才构建消息。voidLogger. logp(Level level, String sourceClass, String sourceMethod, Throwable thrown, Supplier<String> msgSupplier)记录一个延迟构造的消息,指定源类和方法,以及相关的Throwable信息。voidLogger. logp(Level level, String sourceClass, String sourceMethod, Supplier<String> msgSupplier)记录一个延迟构造的消息,指定源类和方法,不带参数。voidLogger. severe(Supplier<String> msgSupplier)记录SEVERE消息,该消息仅在日志记录级别实际记录消息时才构建。voidLogger. warning(Supplier<String> msgSupplier)记录一条WARNING消息,该消息仅在日志记录级别实际记录消息时才构建。 -
Uses of Supplier in java.util.stream
Methods in java.util.stream that return Supplier 变量和类型 方法 描述 Supplier<A>Collector. supplier()一个创建并返回新的可变结果容器的函数。Methods in java.util.stream with parameters of type Supplier 变量和类型 方法 描述 <R> RDoubleStream. collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R,R> combiner)对此流的元素执行 mutable reduction操作。<R> RIntStream. collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R,R> combiner)对此流的元素执行 mutable reduction操作。<R> RLongStream. collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R,R> combiner)对此流的元素执行 mutable reduction操作。<R> RStream. collect(Supplier<R> supplier, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)对此流的元素执行 mutable reduction操作。static DoubleStreamStreamSupport. doubleStream(Supplier<? extends Spliterator.OfDouble> supplier, int characteristics, boolean parallel)创建一个新的顺序或并行DoubleStream从Supplier的Spliterator.OfDouble。static <T> Stream<T>Stream. generate(Supplier<? extends T> s)返回无限顺序无序流,其中每个元素由提供的Supplier生成。static <T,K,D,A,M extends Map<K,D>>
Collector<T,?,M>Collectors. groupingBy(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)返回Collector“由基团”上的类型的输入元件操作实现级联T,根据分类功能分组元素,然后使用下游的指定与给定键相关联的值进行还原操作Collector。static <T,K,A,D,M extends ConcurrentMap<K,D>>
Collector<T,?,M>Collectors. groupingByConcurrent(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)返回并发Collector,对类型为T输入元素执行级联“group by”操作,根据分类函数对元素进行分组,然后使用指定的下游Collector对与给定键关联的值执行缩减操作。static IntStreamStreamSupport. intStream(Supplier<? extends Spliterator.OfInt> supplier, int characteristics, boolean parallel)创建一个新的顺序或并行IntStream从Supplier的Spliterator.OfInt。static LongStreamStreamSupport. longStream(Supplier<? extends Spliterator.OfLong> supplier, int characteristics, boolean parallel)创建一个新的顺序或并行LongStream从Supplier的Spliterator.OfLong。static <T,A,R>
Collector<T,A,R>Collector. of(Supplier<A> supplier, BiConsumer<A,T> accumulator, BinaryOperator<A> combiner, Function<A,R> finisher, Collector.Characteristics... characteristics)返回一个新Collector由给定的描述supplier,accumulator,combiner和finisher功能。static <T,R>
Collector<T,R,R>Collector. of(Supplier<R> supplier, BiConsumer<R,T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics)返回一个新Collector由给定的描述supplier,accumulator和combiner功能。static <T> Stream<T>StreamSupport. stream(Supplier<? extends Spliterator<T>> supplier, int characteristics, boolean parallel)创建一个新的顺序或并行Stream从Supplier的Spliterator。static <T,C extends Collection<T>>
Collector<T,?,C>Collectors. toCollection(Supplier<C> collectionFactory)返回Collector,其累积的输入元素融入到新的Collection,在遭遇订单。static <T,K,U,M extends ConcurrentMap<K,U>>
Collector<T,?,M>Collectors. toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapFactory)返回并发Collector,它将元素累积到ConcurrentMap其键和值是将提供的映射函数应用于输入元素的结果。static <T,K,U,M extends Map<K,U>>
Collector<T,?,M>Collectors. toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapFactory)返回Collector,它将元素累积到Map其键和值是将提供的映射函数应用于输入元素的结果。 -
Uses of Supplier in jdk.dynalink.linker
Classes in jdk.dynalink.linker that implement Supplier 变量和类型 类 描述 classGuardingDynamicLinkerExporter作为保护动态链接器的供应商的类,可以由其他语言运行时自动加载。Methods in jdk.dynalink.linker with parameters of type Supplier 变量和类型 方法 描述 GuardedInvocationGuardingTypeConverterFactory. convertToType(类<?> sourceType, 类<?> targetType, Supplier<MethodHandles.Lookup> lookupSupplier)返回一个受保护的类型转换,它接收指定源类型的值并返回转换为指定目标类型的值。<T> TLinkerServices. getWithLookup(Supplier<T> operation, SecureLookupSupplier lookupSupplier)在特定MethodHandles.Lookup查找对象的上下文中执行操作。 -
Uses of Supplier in jdk.jshell
Methods in jdk.jshell with parameters of type Supplier 变量和类型 方法 描述 JShell.BuilderJShell.Builder. tempVariableNameGenerator(Supplier<String> generator)为VarSnippet的Snippet.SubKind.TEMP_VAR_EXPRESSION_SUBKIND设置临时变量名称的生成器。
-