mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-07-01 02:46:37 +02:00
27 lines
966 B
C#
27 lines
966 B
C#
using System.Collections;
|
|
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();
|
|
}
|
|
}
|
|
}
|