Renames Pz2Bean to Pz2Service
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / commands / CommandParameter.java
index f97497f..b22962e 100644 (file)
@@ -24,12 +24,12 @@ public class CommandParameter implements Serializable {
   private static List<String> nologparams = Arrays.asList("password");\r
   \r
   public CommandParameter (String name) {\r
-    logger.debug("Instantiating command parameter '" + name + "'");\r
+    logger.trace("Instantiating command parameter '" + name + "'");\r
     this.name = name;\r
   }\r
   \r
   public CommandParameter (String name, String operator, String value, Expression... expressions) {\r
-    logger.debug("Instantiating command parameter " + name + " with expressions: [" + expressions + "]");\r
+    logger.trace("Instantiating command parameter " + name + " with expressions: [" + expressions + "]");\r
     this.name = name;\r
     this.operator = operator;\r
     this.value = value;\r
@@ -39,14 +39,14 @@ public class CommandParameter implements Serializable {
   }\r
 \r
   public CommandParameter (String name, String operator, String value) {\r
-    if (!nologparams.contains(name)) logger.debug("Instantiating command parameter '" + name + "' with String: [" + value + "]");    \r
+    if (!nologparams.contains(name)) logger.trace("Instantiating command parameter '" + name + "' with String: [" + value + "]");    \r
     this.name = name;\r
     this.operator = operator;\r
     this.value = value;    \r
   }\r
   \r
   public CommandParameter (String name, String operator, int value) {\r
-    logger.debug("Instantiating command parameter '" + name + "' with int: [" + value + "]");\r
+    logger.trace("Instantiating command parameter '" + name + "' with int: [" + value + "]");\r
     this.name = name;\r
     this.operator = operator;\r
     this.value = value+"";    \r
@@ -75,6 +75,10 @@ public class CommandParameter implements Serializable {
     return operator != null;\r
   }\r
   \r
+  public boolean hasValue() {\r
+    return value != null && value.length()>0;\r
+  }\r
+  \r
   public String getEncodedQueryString () {\r
     try {\r
       return name + operator + URLEncoder.encode(getValueWithExpressions(),"UTF-8");\r
@@ -114,7 +118,7 @@ public class CommandParameter implements Serializable {
   }\r
   \r
   public CommandParameter copy() {\r
-    logger.debug("Copying parameter '"+ name + "' for modification");\r
+    logger.trace("Copying parameter '"+ name + "' for modification");\r
     CommandParameter newParam = new CommandParameter(name);\r
     newParam.value = this.value;\r
     newParam.operator = this.operator;\r