Uses of Interface
java.util.function.Supplier
-
Packages that use Supplier 软件包 描述 java.lang 提供对Java编程语言设计至关重要的类。java.lang.module 通过分辨率和服务绑定来支持模块描述符和创建模块配置的类。java.util 包含集合框架,一些国际化支持类,一个服务加载器,属性,随机数生成,字符串解析和扫描类,base64编码和解码,一个位数组和几个其他实用程序类。java.util.concurrent 实用程序类通常用于并发编程。java.util.logging 提供Java¢2平台核心日志记录工具的类和接口。java.util.stream 支持元素流功能性操作的类,例如集合上的map-reduce转换。jdk.dynalink.linker 包含语言运行时所需的接口和类,以实现自己的特定于语言的对象模型和类型转换。jdk.incubator.http 高级HTTP和WebSocket APIjdk.jshell 提供用于创建工具的界面,例如阅读评估打印循环(REPL),它交互地评估Java编程语言代码的“片断”。 -
-
Uses of Supplier in java.lang
Methods in java.lang with parameters of type Supplier Modifier and Type 方法 描述 default voidSystem.Logger. log(System.Logger.Level level, Supplier<String> msgSupplier)记录一个懒惰的提供的消息。default voidSystem.Logger. log(System.Logger.Level level, Supplier<String> msgSupplier, Throwable thrown)记录与给定的可抛物线相关联的延迟提供的消息。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 Modifier and Type 方法 描述 static ModuleDescriptorModuleDescriptor. read(InputStream in, Supplier<Set<String>> packageFinder)从输入流读取模块声明的二进制形式作为模块描述符。static ModuleDescriptorModuleDescriptor. read(ByteBuffer bb, Supplier<Set<String>> packageFinder)从字节缓冲区中读取模块声明的二进制形式作为模块描述符。 -
Uses of Supplier in java.util
Subinterfaces of Supplier in java.util Modifier and Type 接口 描述 static interfaceServiceLoader.Provider<S>代表由ServiceLoader位于的服务提供商。Methods in java.util with parameters of type Supplier Modifier and Type 方法 描述 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 Modifier and Type 方法 描述 CompletableFuture<T>CompletableFuture. completeAsync(Supplier<? extends T> supplier)使用默认执行程序从异步任务调用给定的供应商函数的结果,完成此CompletableFuture。CompletableFuture<T>CompletableFuture. completeAsync(Supplier<? extends T> supplier, Executor executor)使用给定的执行器从异步任务调用给定的供应商函数的结果来完成此CompletableFuture。static <U> CompletableFuture<U>CompletableFuture. supplyAsync(Supplier<U> supplier)返回一个新的CompletableFuture,它由在ForkJoinPool.commonPool()中运行的任务异步完成,并通过调用给定的供应商获得的值。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 Modifier and Type 方法 描述 voidLogger. config(Supplier<String> msgSupplier)记录一个CONFIG消息,只有在记录级别实际上记录该消息时,才能构建一个CONFIG消息。voidLogger. fine(Supplier<String> msgSupplier)记录一个FINE消息,只有在记录级别实际上记录该消息时才会被构造。voidLogger. finer(Supplier<String> msgSupplier)记录一个FINER消息,只有在记录级别实际上记录该消息时,才会构建一个FINER消息。voidLogger. finest(Supplier<String> msgSupplier)记录一个FINEST消息,只有当记录级别实际上记录消息时,才能构建FINEST消息。voidLogger. info(Supplier<String> msgSupplier)记录INFO消息,只有在记录级别实际记录消息时,才能构建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消息,只有当记录级别实际上记录该消息时,才会构建一个SEVERE消息。voidLogger. warning(Supplier<String> msgSupplier)记录一条警告消息,只有当记录级别实际上记录消息时,才能构建一条警告消息。 -
Uses of Supplier in java.util.stream
Methods in java.util.stream that return Supplier Modifier and Type 方法 描述 Supplier<A>Collector. supplier()一个创建并返回一个新的可变结果容器的函数。Methods in java.util.stream with parameters of type Supplier Modifier and Type 方法 描述 <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类型的输入元素执行级联“分组”操作,根据分类功能分组元素,然后使用指定的下游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 Modifier and Type Class 描述 classGuardingDynamicLinkerExporter作为保护动态链接器的供应商的类,可以由其他语言运行时自动加载。Methods in jdk.dynalink.linker with parameters of type Supplier Modifier and Type 方法 描述 GuardedInvocationGuardingTypeConverterFactory. convertToType(Class<?> sourceType, Class<?> targetType, Supplier<MethodHandles.Lookup> lookupSupplier)返回受保护的类型转换,它接收指定的源类型的值,并返回转换为指定的目标类型的值。<T> TLinkerServices. getWithLookup(Supplier<T> operation, SecureLookupSupplier lookupSupplier)在特定的MethodHandles.Lookup查找对象的上下文中执行操作。 -
Uses of Supplier in jdk.incubator.http
Methods in jdk.incubator.http with parameters of type Supplier Modifier and Type 方法 描述 static HttpRequest.BodyProcessorHttpRequest.BodyProcessor. fromInputStream(Supplier<? extends InputStream> streamSupplier)请求体处理器从InputStream中读取其数据。 -
Uses of Supplier in jdk.jshell
Methods in jdk.jshell with parameters of type Supplier Modifier and Type 方法 描述 JShell.BuilderJShell.Builder. tempVariableNameGenerator(Supplier<String> generator)为VarSnippet设置Snippet.SubKind.TEMP_VAR_EXPRESSION_SUBKIND的临时变量名称生成器。
-