using System.Collections.Generic; using System.Linq; namespace TINK.Model.Connector.Filter { public static class GroupFilterFactory { /// /// Creates filter object. /// /// if value consists /// - list of strings entries are used to filter (intersect) with or if value is /// - null or an empty list null filter is applied, i.e. filtering is off. /// Filtering object. /// /// Tread group values of null and empty lists as marker to turn filtering off to handle COPRI responses maximal flexible. /// public static IGroupFilter Create(IEnumerable group) { return group != null && group.Count() > 0 ? (IGroupFilter)new IntersectGroupFilter(group) : new NullGroupFilter(); } } }