colesico.framework.dslvalidator.commands.ConditionalChain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of colesico-validation Show documentation
Show all versions of colesico-validation Show documentation
Colesico framework data bean validation assistant and simple dsl validator
package colesico.framework.dslvalidator.commands;
import colesico.framework.dslvalidator.ValidationContext;
import java.util.function.Predicate;
/**
* Executes chain commands if condition is met.
*
* @see ChainSequence
*/
public class ConditionalChain extends AbstractSequence {
private final Predicate condition;
public ConditionalChain(Predicate condition) {
this.condition = condition;
}
@Override
public void execute(ValidationContext context) {
if (condition.test(context)) {
executeChain(context);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy