@Test void with() { rule = when(A.with(firstDayOfYear()).eq(LocalDate.of(1, 1, 1))).validate(); result = rule.executeOn(model); reduce = result.reduce(FAILURE); assertFalse(result.value()); assertThat(rule.readable(LOCALE)).isEqualTo("rule when A with first day of year = 0001-01-01 validate"); assertThat(result.getFailureCause(LOCALE)).isEqualTo("A with first day of year = 0001-01-01"); }
public final TemporalFunction<N> with(TemporalAdjuster adjuster) { return temporalFunction(withMetadata(metadata, adjuster.getMetadata()), (model, context) -> value(model, context).map(v -> withFunction(adjuster.getAdjuster()).apply(v))); }
TemporalFunction extends DefaultFunction<N, PredicateMetadata> implements TemporalOperators<N> { public final TemporalFunction<N> with(TemporalAdjuster adjuster) { return temporalFunction(withMetadata(metadata, adjuster.getMetadata()), (model, context) -> value(model, context).map(v -> withFunction(adjuster.getAdjuster()).apply(v))); } }
TemporalFunction extends DefaultFunction<N, PredicateMetadata> implements TemporalOperators<N> { public final TemporalFunction<N> with(TemporalAdjuster adjuster) { return temporalFunction(withMetadata(metadata, adjuster.getMetadata()), (model, context) -> value(model, context).map(v -> withFunction(adjuster.getAdjuster()).apply(v))); } protected  TemporalFunction(PredicateMetadata metadata, BiFunction<FieldModel, Context, Optional<N>> value); }
TemporalFunction extends DefaultFunction<N, PredicateMetadata> implements TemporalOperators<N> { public final TemporalFunction<N> with(TemporalAdjuster adjuster) { return temporalFunction(withMetadata(metadata, adjuster.getMetadata()), (model, context) -> value(model, context).map(v -> withFunction(adjuster.getAdjuster()).apply(v))); } protected  TemporalFunction(PredicateMetadata metadata, BiFunction<FieldModel, Context, Optional<N>> value); final StepCondition eq(TemporalFunction<N> value); final StepCondition before(N value); final StepCondition before(TemporalFieldInfo<N> value); final StepCondition before(Supplier<N> value); final StepCondition before(TemporalFunction<N> value); final StepCondition beforeOrEq(N value); final StepCondition beforeOrEq(TemporalFieldInfo<N> value); final StepCondition beforeOrEq(Supplier<N> value); final StepCondition beforeOrEq(TemporalFunction<N> value); final StepCondition after(N value); final StepCondition after(TemporalFieldInfo<N> value); final StepCondition after(Supplier<N> value); final StepCondition after(TemporalFunction<N> value); final StepCondition afterOrEq(N value); final StepCondition afterOrEq(TemporalFieldInfo<N> value); final StepCondition afterOrEq(Supplier<N> value); final StepCondition afterOrEq(TemporalFunction<N> value); final StepCondition between(N minIncluded, N maxExcluded); final StepCondition between(Supplier<N> minIncluded, Supplier<N> maxExcluded); final StepCondition between(TemporalFunction<N> minIncluded, TemporalFunction<N> maxExcluded); final StepCondition notBetween(N minIncluded, N maxExcluded); final StepCondition notBetween(Supplier<N> minIncluded, Supplier<N> maxExcluded); final StepCondition notBetween(TemporalFunction<N> minIncluded, TemporalFunction<N> maxExcluded); final TemporalFunction<N> with(TemporalAdjuster adjuster); final TemporalFunction<N> minus(int value, TemporalUnit unit); final TemporalFunction<N> minus(NumericFieldInfo<Integer> value, TemporalUnit unit); final TemporalFunction<N> minus(NumericFunction<Integer> function, TemporalUnit unit); final TemporalFunction<N> plus(int value, TemporalUnit unit); final TemporalFunction<N> plus(NumericFieldInfo<Integer> value, TemporalUnit unit); final TemporalFunction<N> plus(NumericFunction<Integer> function, TemporalUnit unit); final NumericFunction<Integer> ageAt(N value); final NumericFunction<Integer> ageAt(TemporalFieldInfo<N> value); final NumericFunction<Integer> ageAt(TemporalFunction<N> value); final NumericFunction<Integer> ageAt(Supplier<N> value); final NumericFunction<Integer> daysBetween(N value); final NumericFunction<Integer> daysBetween(TemporalFieldInfo<N> value); final NumericFunction<Integer> daysBetween(TemporalFunction<N> value); final NumericFunction<Integer> daysBetween(Supplier<N> value); final NumericFunction<Integer> monthsBetween(N value); final NumericFunction<Integer> monthsBetween(TemporalFieldInfo<N> value); final NumericFunction<Integer> monthsBetween(TemporalFunction<N> value); final NumericFunction<Integer> monthsBetween(Supplier<N> value); final NumericFunction<Integer> yearsBetween(N value); final NumericFunction<Integer> yearsBetween(TemporalFieldInfo<N> value); final NumericFunction<Integer> yearsBetween(TemporalFunction<N> value); final NumericFunction<Integer> yearsBetween(Supplier<N> value); }
TemporalFunction extends DefaultFunction<N, PredicateMetadata> implements TemporalOperators<N> { public final TemporalFunction<N> with(TemporalAdjuster adjuster) { return temporalFunction(withMetadata(metadata, adjuster.getMetadata()), (model, context) -> value(model, context).map(v -> withFunction(adjuster.getAdjuster()).apply(v))); } protected  TemporalFunction(PredicateMetadata metadata, BiFunction<FieldModel, Context, Optional<N>> value); final StepCondition eq(TemporalFunction<N> value); final StepCondition before(N value); final StepCondition before(TemporalFieldInfo<N> value); final StepCondition before(Supplier<N> value); final StepCondition before(TemporalFunction<N> value); final StepCondition beforeOrEq(N value); final StepCondition beforeOrEq(TemporalFieldInfo<N> value); final StepCondition beforeOrEq(Supplier<N> value); final StepCondition beforeOrEq(TemporalFunction<N> value); final StepCondition after(N value); final StepCondition after(TemporalFieldInfo<N> value); final StepCondition after(Supplier<N> value); final StepCondition after(TemporalFunction<N> value); final StepCondition afterOrEq(N value); final StepCondition afterOrEq(TemporalFieldInfo<N> value); final StepCondition afterOrEq(Supplier<N> value); final StepCondition afterOrEq(TemporalFunction<N> value); final StepCondition between(N minIncluded, N maxExcluded); final StepCondition between(Supplier<N> minIncluded, Supplier<N> maxExcluded); final StepCondition between(TemporalFunction<N> minIncluded, TemporalFunction<N> maxExcluded); final StepCondition notBetween(N minIncluded, N maxExcluded); final StepCondition notBetween(Supplier<N> minIncluded, Supplier<N> maxExcluded); final StepCondition notBetween(TemporalFunction<N> minIncluded, TemporalFunction<N> maxExcluded); final TemporalFunction<N> with(TemporalAdjuster adjuster); final TemporalFunction<N> minus(int value, TemporalUnit unit); final TemporalFunction<N> minus(NumericFieldInfo<Integer> value, TemporalUnit unit); final TemporalFunction<N> minus(NumericFunction<Integer> function, TemporalUnit unit); final TemporalFunction<N> plus(int value, TemporalUnit unit); final TemporalFunction<N> plus(NumericFieldInfo<Integer> value, TemporalUnit unit); final TemporalFunction<N> plus(NumericFunction<Integer> function, TemporalUnit unit); final NumericFunction<Integer> ageAt(N value); final NumericFunction<Integer> ageAt(TemporalFieldInfo<N> value); final NumericFunction<Integer> ageAt(TemporalFunction<N> value); final NumericFunction<Integer> ageAt(Supplier<N> value); final NumericFunction<Integer> daysBetween(N value); final NumericFunction<Integer> daysBetween(TemporalFieldInfo<N> value); final NumericFunction<Integer> daysBetween(TemporalFunction<N> value); final NumericFunction<Integer> daysBetween(Supplier<N> value); final NumericFunction<Integer> monthsBetween(N value); final NumericFunction<Integer> monthsBetween(TemporalFieldInfo<N> value); final NumericFunction<Integer> monthsBetween(TemporalFunction<N> value); final NumericFunction<Integer> monthsBetween(Supplier<N> value); final NumericFunction<Integer> yearsBetween(N value); final NumericFunction<Integer> yearsBetween(TemporalFieldInfo<N> value); final NumericFunction<Integer> yearsBetween(TemporalFunction<N> value); final NumericFunction<Integer> yearsBetween(Supplier<N> value);  }