jio.EventBuilder Maven / Gradle / Ivy
The newest version!
package jio;
import static java.util.Objects.requireNonNull;
import java.util.function.Function;
/**
* Represents a builder to create JFR {@link jdk.jfr.consumer.RecordedEvent} from computations performed by the JIO API.
* Some event fields can be customized. The event message of a successful computation is by default the string
* representation of the result and can be customized with the method {@link #withSuccessOutput(Function)}. The failure
* message of a fail computation is by default exception.getClass().getName():exception.getMessage()
and
* can be customized with the method {@link #withFailureOutput(Function)}.
*
* Expressions made up of different subexpressions generate different JFR events that can be correlated with a context
* specified with the constructor {@link EventBuilder#EventBuilder(String, String)}.
*
* @param