From a435d43b65859fa6384fd1edb2dd6e7f38f095fe Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Mon, 17 Mar 2014 14:38:12 +0000
Subject: [PATCH] Checkpoint commit for OPENDJ-1308 Migrate schema support

---
 opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java b/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
index 4068095..b9bc820 100644
--- a/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
+++ b/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
@@ -115,9 +115,13 @@
 import org.opends.quicksetup.Installation;
 import org.opends.quicksetup.ui.UIFactory;
 import org.opends.quicksetup.util.Utils;
+import org.opends.server.api.ApproximateMatchingRule;
 import org.opends.server.api.AttributeSyntax;
 import org.opends.server.api.ConfigHandler;
+import org.opends.server.api.EqualityMatchingRule;
 import org.opends.server.api.MatchingRule;
+import org.opends.server.api.OrderingMatchingRule;
+import org.opends.server.api.SubstringMatchingRule;
 import org.opends.server.config.ConfigEntry;
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.core.LockFileManager;
@@ -2854,4 +2858,49 @@
       }
     }
   }
+
+  /**
+   * Indicates if the provided matching rule is an equality matching rule.
+   *
+   * @param matchingRule
+   *            The matching rule.
+   * @return {@code true} if this matching rule is an equality mathing rule.
+   */
+  public static boolean isEqualityMatchingRule(MatchingRule matchingRule) {
+    return matchingRule instanceof EqualityMatchingRule;
+  }
+
+  /**
+   * Indicates if the provided matching rule is an approximate matching rule.
+   *
+   * @param matchingRule
+   *            The matching rule.
+   * @return {@code true} if this matching rule is an approximate mathing rule.
+   */
+  public static boolean isApproximateMatchingRule(MatchingRule matchingRule) {
+    return matchingRule instanceof ApproximateMatchingRule;
+  }
+
+  /**
+   * Indicates if the provided matching rule is a substring matching rule.
+   *
+   * @param matchingRule
+   *            The matching rule.
+   * @return {@code true} if this matching rule is a substring mathing rule.
+   */
+  public static boolean isSubstringMatchingRule(MatchingRule matchingRule) {
+    return matchingRule instanceof SubstringMatchingRule;
+  }
+
+  /**
+   * Indicates if the provided matching rule is an ordering matching rule.
+   *
+   * @param matchingRule
+   *            The matching rule.
+   * @return {@code true} if this matching rule is an ordering mathing rule.
+   */
+  public static boolean isOrderingMatchingRule(MatchingRule matchingRule) {
+    return matchingRule instanceof OrderingMatchingRule;
+  }
+
 }

--
Gitblit v1.10.0