/src/LinFu.Finders/Criteria.cs

http://github.com/philiplaureano/LinFu · C# · 29 lines · 11 code · 3 blank · 15 comment · 0 complexity · 36346d87a79d8f19dad66da33e76bc6b MD5 · raw file

  1. using System;
  2. using LinFu.Finders.Interfaces;
  3. namespace LinFu.Finders
  4. {
  5. /// <summary>
  6. /// Represents the default implementation of the <see cref="ICriteria{T}" /> interface.
  7. /// </summary>
  8. /// <typeparam name="T">The type of item to test.</typeparam>
  9. public class Criteria<T> : ICriteria<T>
  10. {
  11. /// <summary>
  12. /// Gets or sets a value indicating the <see cref="CriteriaType" />
  13. /// of the current <see cref="Criteria{T}" />.
  14. /// </summary>
  15. public CriteriaType Type { get; set; }
  16. /// <summary>
  17. /// The condition that will determine whether or not
  18. /// the target item matches the criteria.
  19. /// </summary>
  20. public Func<T, bool> Predicate { get; set; }
  21. /// <summary>
  22. /// The weight of the given <see cref="Predicate" />.
  23. /// </summary>
  24. public int Weight { get; set; }
  25. }
  26. }