rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/RuleBuilder.java
@SuppressWarnings("unchecked")
  public GivenRuleBuilder<T, U> given(String name, T value) {
    Rule<T, U> rule = _name.map(ruleName -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), ruleName)).orElse(newRule());
    if (rule == null) {
      throw new IllegalStateException("No Rule is instantiated; An invalid Rule class may have been provided");
    }
    return new GivenRuleBuilder<T, U>(rule, new Fact<T>(name, value));
  }
@SuppressWarnings("unchecked")
  public GivenRuleBuilder<T, U> given(String name, T value) {
    Rule<T, U> rule = _name.map(ruleName -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), ruleName)).orElse(newRule());
    if (rule == null) {
      throw new IllegalStateException("No Rule is instantiated; An invalid Rule class may have been provided");
    }
    return new GivenRuleBuilder<T, U>(rule, new Fact<T>(name, value));
  }
@ SuppressWarnings ( "unchecked" ) public GivenRuleBuilder < T , U > given ( String name , T value ) { Rule < T , U > rule = _name . map ( ruleName -> ( Rule < T , U > ) new AuditableRule < T , U > ( newRule ( ) , ruleName ) ) . orElse ( newRule ( ) ) ; if ( rule == null ) { throw new IllegalStateException ( "No Rule is instantiated; An invalid Rule class may have been provided" ) ; } return new GivenRuleBuilder < T , U > ( rule , new Fact < T > ( name , value ) ) ; }
Adds a fact to the Rule using a name value pair to specify a new fact.
@param name    the name of the fact
@param value   the value of the fact
@return        a builder for building rules after a 'given' statement
Adds a fact to the Rule using a name value pair to specify a new fact .