JAL-2850 JAL-1766 option to load contig sequence referenced by VCF
[jalview.git] / src / jalview / util / matcher / KeyedMatcher.java
index ef1c702..f21756a 100644 (file)
@@ -73,22 +73,24 @@ public class KeyedMatcher implements KeyedMatcherI
   }
 
   /**
-   * Answers a string description of this matcher, suitable for debugging or
-   * logging. The format may change in future.
+   * Answers a string description of this matcher, suitable for display, debugging
+   * or logging. The format may change in future.
    */
   @Override
   public String toString()
   {
     StringBuilder sb = new StringBuilder();
     sb.append(String.join(COLON, key)).append(" ")
-            .append(matcher.getCondition().toString()).append(" ");
-    if (matcher.getCondition().isNumeric())
+            .append(matcher.getCondition().toString());
+    Condition condition = matcher.getCondition();
+    if (condition.isNumeric())
     {
-      sb.append(matcher.getPattern());
+      sb.append(" ").append(matcher.getPattern());
     }
-    else
+    else if (condition != Condition.Present
+            && condition != Condition.NotPresent)
     {
-      sb.append("'").append(matcher.getPattern()).append("'");
+      sb.append(" '").append(matcher.getPattern()).append("'");
     }
 
     return sb.toString();