# Uses of Interface
org.springframework.util.function.ThrowingConsumer

Packages that use ThrowingConsumer
Package
Description
org.springframework.aot.generate
Support classes for components that contribute generated code equivalent to a runtime behavior.
org.springframework.util.function
Useful generic `java.util.function` helper classes.

## Uses of ThrowingConsumer in org.springframework.aot.generate

Methods in org.springframework.aot.generate with parameters of type ThrowingConsumer
Modifier and Type
Method
Description
`default void`
GeneratedFiles.`addFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<Appendable> content)`
Add a generated file of the specified `GeneratedFiles.Kind` with content written to an `Appendable` passed to the given `ThrowingConsumer`.
`default void`
GeneratedFiles.`addResourceFile(String path, ThrowingConsumer<Appendable> content)`
Add a generated `resource file` with content written to an `Appendable` passed to the given `ThrowingConsumer`.
`default void`
GeneratedFiles.`addSourceFile(String className, ThrowingConsumer<Appendable> content)`
Add a generated `source file` with content written to an `Appendable` passed to the given `ThrowingConsumer`.
`void`
FileSystemGeneratedFiles.`handleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler)`
`void`
GeneratedFiles.`handleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler)`
Handle a generated file of the specified `GeneratedFiles.Kind` with the given handler.
`void`
InMemoryGeneratedFiles.`handleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler)`

## Uses of ThrowingConsumer in org.springframework.util.function

Methods in org.springframework.util.function that return ThrowingConsumer
Modifier and Type
Method
Description
`static <T> ThrowingConsumer<T>`
ThrowingConsumer.`of(ThrowingConsumer<T> consumer)`
Lambda friendly convenience method that can be used to create a `ThrowingConsumer` where the `accept(Object)` method wraps any checked exception thrown by the supplied lambda expression or method reference.
`static <T> ThrowingConsumer<T>`
ThrowingConsumer.`of(ThrowingConsumer<T> consumer, BiFunction<String,Exception,RuntimeException> exceptionWrapper)`
Lambda friendly convenience method that can be used to create a `ThrowingConsumer` where the `accept(Object)` method wraps any thrown checked exceptions using the given `exceptionWrapper`.
`default ThrowingConsumer<T>`
ThrowingConsumer.`throwing(BiFunction<String,Exception,RuntimeException> exceptionWrapper)`
Return a new `ThrowingConsumer` where the `accept(Object)` method wraps any thrown checked exceptions using the given `exceptionWrapper`.
Methods in org.springframework.util.function with parameters of type ThrowingConsumer
Modifier and Type
Method
Description
`static <T> ThrowingConsumer<T>`
ThrowingConsumer.`of(ThrowingConsumer<T> consumer)`
Lambda friendly convenience method that can be used to create a `ThrowingConsumer` where the `accept(Object)` method wraps any checked exception thrown by the supplied lambda expression or method reference.
`static <T> ThrowingConsumer<T>`
ThrowingConsumer.`of(ThrowingConsumer<T> consumer, BiFunction<String,Exception,RuntimeException> exceptionWrapper)`
Lambda friendly convenience method that can be used to create a `ThrowingConsumer` where the `accept(Object)` method wraps any thrown checked exceptions using the given `exceptionWrapper`.