/** * A {@code double} specialized version of {@link #checkPrecondition(Object, * boolean, Function)} * * @param value The value * @param condition The predicate * @param describer The describer of the predicate * * @return value * * @throws PreconditionViolationException If the predicate is false */ public static double checkPreconditionD( final double value, final boolean condition, final DoubleFunction<String> describer) { return innerCheckD(value, condition, describer); }
/** * A {@code double} specialized version of {@link #checkPrecondition(Object, * boolean, Function)} * * @param value The value * @param condition The predicate * @param describer The describer of the predicate * * @return value * * @throws PreconditionViolationException If the predicate is false */ public static double checkPreconditionD( final double value, final boolean condition, final DoubleFunction<String> describer) { return innerCheckD(value, condition, describer); }
/** * A {@code double} specialized version of {@link #checkPrecondition(Object, * Predicate, Function)} * * @param value The value * @param predicate The predicate * @param describer The describer of the predicate * * @return value * * @throws PreconditionViolationException If the predicate is false */ public static double checkPreconditionD( final double value, final DoublePredicate predicate, final DoubleFunction<String> describer) { final boolean ok; try { ok = predicate.test(value); } catch (final Throwable e) { throw failed( Double.valueOf(value), singleViolation(failedPredicate(e))); } return innerCheckD(value, ok, describer); }
/** * A {@code double} specialized version of {@link #checkPrecondition(Object, * Predicate, Function)} * * @param value The value * @param predicate The predicate * @param describer The describer of the predicate * * @return value * * @throws PreconditionViolationException If the predicate is false */ public static double checkPreconditionD( final double value, final DoublePredicate predicate, final DoubleFunction<String> describer) { final boolean ok; try { ok = predicate.test(value); } catch (final Throwable e) { throw failed( Double.valueOf(value), singleViolation(failedPredicate(e))); } return innerCheckD(value, ok, describer); }