Interface SafeComputable<I,O>

Type Parameters:
I - Input type of computable
O - Output type of computable
All Superinterfaces:
org.apache.commons.lang3.concurrent.Computable<I,O>
All Known Implementing Classes:
SafeComputable.Wrapper

public interface SafeComputable<I,O> extends org.apache.commons.lang3.concurrent.Computable<I,O>
Represents a computable that handles any errors inside itself
  • Method Details

    • wrap

      @Contract("_ -> new") @NotNull static <I, O> @NotNull SafeComputable<I,O> wrap(org.apache.commons.lang3.concurrent.Computable<I,O> c)
    • safeCompute

      O safeCompute(I input)
      Safely computes the input, handling any errors inside itself, only throwing a SafeComputable.ComputeInterruptionException if the thread is interrupted
      Parameters:
      input - Input value
      Returns:
      Output value
    • compute

      default O compute(I arg)
      Specified by:
      compute in interface org.apache.commons.lang3.concurrent.Computable<I,O>