Skip to content

Commit

Permalink
feat: add new methods to IFilterService for bulk filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
elementh committed Aug 4, 2021
1 parent 31752be commit fcc9265
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Thankifi.Common.Filters.Abstractions/IFilterService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualBasic;
Expand Down Expand Up @@ -29,5 +31,24 @@ public interface IFilterService
/// <param name="cancellationToken"><see cref="CancellationToken"/>.</param>
/// <returns>The transformed string or default if something went wrong..</returns>
Task<string?> ApplyOrDefault(string filter, string str, CancellationToken cancellationToken = default);

/// <summary>
/// Applies one or more filters to a string given a filter identifier and an input string.
/// </summary>
/// <param name="filters">The list with the identifiers of the <see cref="IFilter"/>s to apply.</param>
/// <param name="str">The incoming string.</param>
/// <param name="cancellationToken"><see cref="CancellationToken"/>.</param>
/// <exception cref="InvalidFilterException">When the requested filter does not exists.</exception>
/// <returns>The transformed string.</returns>
Task<string> Apply(IEnumerable<string> filters, string str, CancellationToken cancellationToken = default);

/// <summary>
/// Applies one or more filter to a string given a filter identifier and an input string.
/// </summary>
/// <param name="filters">The list with the identifiers of the <see cref="IFilter"/>s to apply.</param>
/// <param name="str">The incoming string.</param>
/// <param name="cancellationToken"><see cref="CancellationToken"/>.</param>
/// <returns>The transformed string or default if something went wrong..</returns>
Task<string?> ApplyOrDefault(IEnumerable<string> filters, string str, CancellationToken cancellationToken = default);
}
}

0 comments on commit fcc9265

Please sign in to comment.