@Override public Void get() throws E { action.run(); return null; } };
/** * Get a supplier which always returns the same value. * * @param value the value to return * @param <T> the value type * @return the value supplier */ @SuppressWarnings("unchecked") public static <T> Supplier<T> constantSupplier(T value) { return value == null ? ConstantSupplier.NULL : new ConstantSupplier<>(value); }
public Object apply(final ExceptionSupplier<Object, E> supplier) throws E { return supplier.get(); } }
/** * Get a supplier which always returns the same value. * * @param value the value to return * @param <T> the value type * @param <E> the exception type * @return the value supplier */ @SuppressWarnings({"unchecked", "rawtypes"}) public static <T, E extends Exception> ExceptionSupplier<T, E> constantExceptionSupplier(T value) { return value == null ? ConstantSupplier.NULL : new ConstantSupplier(value); }