public Pattern<T, F> until(IterativeCondition<F> untilCondition) {
		Preconditions.checkNotNull(untilCondition, "The condition cannot be null");

		if (this.untilCondition != null) {
			throw new MalformedPatternException("Only one until condition can be applied.");
		}

		if (!quantifier.hasProperty(Quantifier.QuantifierProperty.LOOPING)) {
			throw new MalformedPatternException("The until condition is only applicable to looping states.");
		}

		ClosureCleaner.clean(untilCondition, true);
		this.untilCondition = untilCondition;

		return this;
	}
public Pattern < T , F > until ( IterativeCondition < F > untilCondition ) { Preconditions . checkNotNull ( untilCondition , "The condition cannot be null" ) ; if ( this . untilCondition != null ) { throw new MalformedPatternException ( "Only one until condition can be applied." ) ; } if ( ! quantifier . hasProperty ( Quantifier . QuantifierProperty . LOOPING ) ) { throw new MalformedPatternException ( "The until condition is only applicable to looping states." ) ; } ClosureCleaner . clean ( untilCondition , true ) ; this . untilCondition = untilCondition ; return this ; }
Applies a stop condition for a looping state. It allows cleaning the underlying state.

@param untilCondition a condition an event has to satisfy to stop collecting events into looping state
@return The same pattern with applied untilCondition