jbertram commented on code in PR #6038:
URL: https://github.com/apache/activemq-artemis/pull/6038#discussion_r2534241993


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/WildcardConfiguration.java:
##########
@@ -240,4 +240,22 @@ private void replaceChar(StringBuilder result, char 
replace, char replacement) {
          }
       }
    }
+
+   /**
+    * Checks if the given input string represents a valid character that 
matches one of the defined wildcard characters.
+    * <p>
+    * The input string must contain exactly one character. If the input is 
null, empty, or contains more than one
+    * character, an IllegalArgumentException is thrown.
+    *
+    * @param input the input string to check; it must contain exactly one 
character
+    * @return true if the single character in the input matches one of the 
wildcard characters, otherwise false
+    * @throws IllegalArgumentException if the input is null, empty, or 
contains more than one character
+    */
+   public boolean contains(String input) {
+      if (input == null || input.isEmpty() || input.length() > 1) {
+         throw new IllegalArgumentException();
+      }
+      char inputChar = input.charAt(0);

Review Comment:
   I considered that originally but decided against it for some reason(s) that 
I can no longer recall. I'm using `char` now and it's much nicer.



##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/WildcardConfiguration.java:
##########
@@ -240,4 +240,22 @@ private void replaceChar(StringBuilder result, char 
replace, char replacement) {
          }
       }
    }
+
+   /**
+    * Checks if the given input string represents a valid character that 
matches one of the defined wildcard characters.
+    * <p>
+    * The input string must contain exactly one character. If the input is 
null, empty, or contains more than one
+    * character, an IllegalArgumentException is thrown.
+    *
+    * @param input the input string to check; it must contain exactly one 
character
+    * @return true if the single character in the input matches one of the 
wildcard characters, otherwise false
+    * @throws IllegalArgumentException if the input is null, empty, or 
contains more than one character
+    */
+   public boolean contains(String input) {
+      if (input == null || input.isEmpty() || input.length() > 1) {
+         throw new IllegalArgumentException();
+      }
+      char inputChar = input.charAt(0);

Review Comment:
   I considered that originally but decided against it for some reason(s) that 
I can no longer recall. I'm using `char` now, and it's much nicer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to