summary refs log tree commit diff
path: root/crypto/src/util/collections/ISelector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/util/collections/ISelector.cs')
-rw-r--r--crypto/src/util/collections/ISelector.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/src/util/collections/ISelector.cs b/crypto/src/util/collections/ISelector.cs
new file mode 100644
index 000000000..186b922d3
--- /dev/null
+++ b/crypto/src/util/collections/ISelector.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace Org.BouncyCastle.Utilities.Collections
+{
+    /// <summary>Interface for matching objects in an <see cref="IStore{T}"/>.</summary>
+    /// <typeparam name="T">The contravariant type of selectable objects.</typeparam>
+    public interface ISelector<in T>
+        : ICloneable
+    {
+        /// <summary>Match the passed in object, returning true if it would be selected by this selector, false
+        /// otherwise.</summary>
+        /// <param name="candidate">The object to be matched.</param>
+        /// <returns><code>true</code> if the objects is matched by this selector, false otherwise.</returns>
+        bool Match(T candidate);
+    }
+}