using System; using Deltares.Dam.Data; namespace Deltares.Standard.Specifications { public class PredicateSpecification : CompositeSpecification { private readonly Predicate predicate; public PredicateSpecification(Predicate predicate) { if (predicate == default(Predicate)) throw new ArgumentNullException("predicate"); this.predicate = predicate; } #region ISpecification Members /// /// Determines whether the candidate satisfies the specification. /// /// The candidate. /// /// true if the candidate satisfies the specification otherwise, false. /// public override bool IsSatisfiedBy(T candidate) { return this.predicate(candidate); } #endregion } }