sharee.bike-App/TINKLib/Model/Connector/Filter/GroupFilterFactory.cs
Anja Müller-Meißner 0468955d49 Version 3.0.338
2022-09-08 09:55:14 +02:00

26 lines
817 B
C#

using System.Collections.Generic;
using System.Linq;
namespace TINK.Model.Connector.Filter
{
public static class GroupFilterFactory
{
/// <summary>
/// Creates filter object.
/// </summary>
/// <param name="group">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.</param>
/// <returns>Filtering object.</returns>
/// <remarks>
/// Tread group values of null and empty lists as marker to turn filtering off to handle COPRI responses maximal flexible.
/// </remarks>
public static IGroupFilter Create(IEnumerable<string> group)
{
return group != null && group.Count() > 0
? (IGroupFilter)new IntersectGroupFilter(group) :
new NullGroupFilter();
}
}
}