All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.compilit.validation.RuleValidationBuilder Maven / Gradle / Ivy

package com.compilit.validation;

import com.compilit.validation.api.ArgumentAdder;
import com.compilit.validation.api.ContinuingValidationBuilder;
import com.compilit.validation.api.Rule;
import com.compilit.validation.api.ValidationBuilder;
import java.util.Collection;

final class RuleValidationBuilder implements ValidationBuilder {

  private final T value;

  RuleValidationBuilder(final T value) {
    this.value = value;
  }

  @Override
  public ContinuingValidationBuilder compliesWith(final Rule rule) {
    var subject = new Subject<>(rule, value);
    return new ContinuingRuleValidationBuilder<>(subject);
  }

  @Override
  public ContinuingValidationBuilder compliesWith(final Collection> rules) {
    var subject = new Subject<>(rules, value);
    return new ContinuingRuleValidationBuilder<>(subject);
  }

  @Override
  public ArgumentAdder compliesWith(final Rule.WithDualInput rule) {
    var subject = new Subject<>(rule, value);
    return new DualInputArgumentAdder<>(subject);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy