PageRenderTime 140ms CodeModel.GetById 61ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 0ms

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