docs(commons): Clean up Coerce.pinF
ci/woodpecker/push/woodpecker Pipeline failed Details

This commit is contained in:
Johannes Frohnmeyer 2024-05-04 22:06:44 +02:00
parent e1d6f578a8
commit bfc72b4428
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 12 additions and 8 deletions

View File

@ -98,17 +98,21 @@ public class Coerce {
/**
* Example:
* {@code interface Test<T> {
* T get();
* void consume(T t);
* <pre>
* {@code
* interface Test<T> {
* T get();
* void consume(T t);
* }
* class Example {
* Test<?> instance;
* void function() {
* Coerce.pin(instance.get(), v -> instance.consume(v)); // This can compile
* instance.consume(instance.get()); // This cannot
* Test<?> instance;
* void function() {
* Coerce.pin(instance.get(), v -> instance.consume(v)); // This compiles
* instance.consume(instance.get()); // This does not
* }
* }
* }}
* }
* </pre>
*
* @param value The value to pin
* @param func The function to apply to the pinned value