Uses of Interface
java.util.function.Supplier
-
Packages that use Supplier Package Description java.lang Provides classes that are fundamental to the design of the Java programming language.java.lang.module Classes to support module descriptors and creating configurations of modules by means of resolution and service binding.java.util Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.java.util.concurrent Utility classes commonly useful in concurrent programming.java.util.logging Provides the classes and interfaces of the Java™ 2 platform's core logging facilities.java.util.stream Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.jdk.dynalink.linker Contains interfaces and classes needed by language runtimes to implement their own language-specific object models and type conversions.jdk.incubator.http High level HTTP and WebSocket APIjdk.jshell Provides interfaces for creating tools, such as a Read-Eval-Print Loop (REPL), which interactively evaluate "snippets" of Java programming language code. -
-
Uses of Supplier in java.lang
Methods in java.lang with parameters of type Supplier Modifier and Type Method Description default voidSystem.Logger. log(System.Logger.Level level, Supplier<String> msgSupplier)Logs a lazily supplied message.default voidSystem.Logger. log(System.Logger.Level level, Supplier<String> msgSupplier, Throwable thrown)Logs a lazily supplied message associated with a given throwable.static <S> ThreadLocal<S>ThreadLocal. withInitial(Supplier<? extends S> supplier)Creates a thread local variable. -
Uses of Supplier in java.lang.module
Methods in java.lang.module with parameters of type Supplier Modifier and Type Method Description static ModuleDescriptorModuleDescriptor. read(InputStream in, Supplier<Set<String>> packageFinder)Reads the binary form of a module declaration from an input stream as a module descriptor.static ModuleDescriptorModuleDescriptor. read(ByteBuffer bb, Supplier<Set<String>> packageFinder)Reads the binary form of a module declaration from a byte buffer as a module descriptor. -
Uses of Supplier in java.util
Subinterfaces of Supplier in java.util Modifier and Type Interface Description static interfaceServiceLoader.Provider<S>Represents a service provider located byServiceLoader.Methods in java.util with parameters of type Supplier Modifier and Type Method Description Optional<T>Optional. or(Supplier<? extends Optional<? extends T>> supplier)If a value is present, returns anOptionaldescribing the value, otherwise returns anOptionalproduced by the supplying function.TOptional. orElseGet(Supplier<? extends T> supplier)If a value is present, returns the value, otherwise returns the result produced by the supplying function.<X extends Throwable>
TOptional. orElseThrow(Supplier<? extends X> exceptionSupplier)If a value is present, returns the value, otherwise throws an exception produced by the exception supplying function.<X extends Throwable>
doubleOptionalDouble. orElseThrow(Supplier<? extends X> exceptionSupplier)If a value is present, returns the value, otherwise throws an exception produced by the exception supplying function.<X extends Throwable>
intOptionalInt. orElseThrow(Supplier<? extends X> exceptionSupplier)If a value is present, returns the value, otherwise throws an exception produced by the exception supplying function.<X extends Throwable>
longOptionalLong. orElseThrow(Supplier<? extends X> exceptionSupplier)If a value is present, returns the value, otherwise throws an exception produced by the exception supplying function.static <T> TObjects. requireNonNull(T obj, Supplier<String> messageSupplier)Checks that the specified object reference is notnulland throws a customizedNullPointerExceptionif it is.static <T> TObjects. requireNonNullElseGet(T obj, Supplier<? extends T> supplier)Returns the first argument if it is non-nulland otherwise returns the non-nullvalue ofsupplier.get(). -
Uses of Supplier in java.util.concurrent
Methods in java.util.concurrent with parameters of type Supplier Modifier and Type Method Description CompletableFuture<T>CompletableFuture. completeAsync(Supplier<? extends T> supplier)Completes this CompletableFuture with the result of the given Supplier function invoked from an asynchronous task using the default executor.CompletableFuture<T>CompletableFuture. completeAsync(Supplier<? extends T> supplier, Executor executor)Completes this CompletableFuture with the result of the given Supplier function invoked from an asynchronous task using the given executor.static <U> CompletableFuture<U>CompletableFuture. supplyAsync(Supplier<U> supplier)Returns a new CompletableFuture that is asynchronously completed by a task running in theForkJoinPool.commonPool()with the value obtained by calling the given Supplier.static <U> CompletableFuture<U>CompletableFuture. supplyAsync(Supplier<U> supplier, Executor executor)Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier. -
Uses of Supplier in java.util.logging
Methods in java.util.logging with parameters of type Supplier Modifier and Type Method Description voidLogger. config(Supplier<String> msgSupplier)Log a CONFIG message, which is only to be constructed if the logging level is such that the message will actually be logged.voidLogger. fine(Supplier<String> msgSupplier)Log a FINE message, which is only to be constructed if the logging level is such that the message will actually be logged.voidLogger. finer(Supplier<String> msgSupplier)Log a FINER message, which is only to be constructed if the logging level is such that the message will actually be logged.voidLogger. finest(Supplier<String> msgSupplier)Log a FINEST message, which is only to be constructed if the logging level is such that the message will actually be logged.voidLogger. info(Supplier<String> msgSupplier)Log a INFO message, which is only to be constructed if the logging level is such that the message will actually be logged.voidLogger. log(Level level, Throwable thrown, Supplier<String> msgSupplier)Log a lazily constructed message, with associated Throwable information.voidLogger. log(Level level, Supplier<String> msgSupplier)Log a message, which is only to be constructed if the logging level is such that the message will actually be logged.voidLogger. logp(Level level, String sourceClass, String sourceMethod, Throwable thrown, Supplier<String> msgSupplier)Log a lazily constructed message, specifying source class and method, with associated Throwable information.voidLogger. logp(Level level, String sourceClass, String sourceMethod, Supplier<String> msgSupplier)Log a lazily constructed message, specifying source class and method, with no arguments.voidLogger. severe(Supplier<String> msgSupplier)Log a SEVERE message, which is only to be constructed if the logging level is such that the message will actually be logged.voidLogger. warning(Supplier<String> msgSupplier)Log a WARNING message, which is only to be constructed if the logging level is such that the message will actually be logged. -
Uses of Supplier in java.util.stream
Methods in java.util.stream that return Supplier Modifier and Type Method Description Supplier<A>Collector. supplier()A function that creates and returns a new mutable result container.Methods in java.util.stream with parameters of type Supplier Modifier and Type Method Description <R> RDoubleStream. collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R,R> combiner)Performs a mutable reduction operation on the elements of this stream.<R> RIntStream. collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R,R> combiner)Performs a mutable reduction operation on the elements of this stream.<R> RLongStream. collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R,R> combiner)Performs a mutable reduction operation on the elements of this stream.<R> RStream. collect(Supplier<R> supplier, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)Performs a mutable reduction operation on the elements of this stream.static DoubleStreamStreamSupport. doubleStream(Supplier<? extends Spliterator.OfDouble> supplier, int characteristics, boolean parallel)Creates a new sequential or parallelDoubleStreamfrom aSupplierofSpliterator.OfDouble.static <T> Stream<T>Stream. generate(Supplier<? extends T> s)Returns an infinite sequential unordered stream where each element is generated by the providedSupplier.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)Returns aCollectorimplementing a cascaded "group by" operation on input elements of typeT, grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstreamCollector.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)Returns a concurrentCollectorimplementing a cascaded "group by" operation on input elements of typeT, grouping elements according to a classification function, and then performing a reduction operation on the values associated with a given key using the specified downstreamCollector.static IntStreamStreamSupport. intStream(Supplier<? extends Spliterator.OfInt> supplier, int characteristics, boolean parallel)Creates a new sequential or parallelIntStreamfrom aSupplierofSpliterator.OfInt.static LongStreamStreamSupport. longStream(Supplier<? extends Spliterator.OfLong> supplier, int characteristics, boolean parallel)Creates a new sequential or parallelLongStreamfrom aSupplierofSpliterator.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)Returns a newCollectordescribed by the givensupplier,accumulator,combiner, andfinisherfunctions.static <T,R> Collector<T,R,R>Collector. of(Supplier<R> supplier, BiConsumer<R,T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics)Returns a newCollectordescribed by the givensupplier,accumulator, andcombinerfunctions.static <T> Stream<T>StreamSupport. stream(Supplier<? extends Spliterator<T>> supplier, int characteristics, boolean parallel)Creates a new sequential or parallelStreamfrom aSupplierofSpliterator.static <T,C extends Collection<T>>
Collector<T,?,C>Collectors. toCollection(Supplier<C> collectionFactory)Returns aCollectorthat accumulates the input elements into a newCollection, in encounter order.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)Returns a concurrentCollectorthat accumulates elements into aConcurrentMapwhose keys and values are the result of applying the provided mapping functions to the input elements.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)Returns aCollectorthat accumulates elements into aMapwhose keys and values are the result of applying the provided mapping functions to the input elements. -
Uses of Supplier in jdk.dynalink.linker
Classes in jdk.dynalink.linker that implement Supplier Modifier and Type Class Description classGuardingDynamicLinkerExporterA class acting as a supplier of guarding dynamic linkers that can be automatically loaded by other language runtimes.Methods in jdk.dynalink.linker with parameters of type Supplier Modifier and Type Method Description GuardedInvocationGuardingTypeConverterFactory. convertToType(Class<?> sourceType, Class<?> targetType, Supplier<MethodHandles.Lookup> lookupSupplier)Returns a guarded type conversion that receives a value of the specified source type and returns a value converted to the specified target type.<T> TLinkerServices. getWithLookup(Supplier<T> operation, SecureLookupSupplier lookupSupplier)Executes an operation within the context of a particularMethodHandles.Lookuplookup object. -
Uses of Supplier in jdk.incubator.http
Methods in jdk.incubator.http with parameters of type Supplier Modifier and Type Method Description static HttpRequest.BodyProcessorHttpRequest.BodyProcessor. fromInputStream(Supplier<? extends InputStream> streamSupplier)A request body processor that reads its data from anInputStream. -
Uses of Supplier in jdk.jshell
Methods in jdk.jshell with parameters of type Supplier Modifier and Type Method Description JShell.BuilderJShell.Builder. tempVariableNameGenerator(Supplier<String> generator)Sets a generator of temp variable names forVarSnippetofSnippet.SubKind.TEMP_VAR_EXPRESSION_SUBKIND.
-