]> git.mxchange.org Git - jcore.git/commitdiff
Added addToDataSet() for Boolean values
authorRoland Haeder <roland@mxchange.org>
Fri, 14 Aug 2015 13:16:29 +0000 (15:16 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 14 Aug 2015 13:16:29 +0000 (15:16 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java

index c45f31f52984351e1dcb67eaded53492ad31c50e..b030873d4118a530928073b9c1f3edc138257038 100644 (file)
@@ -118,6 +118,32 @@ public abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implement
                this.getLogger().trace("EXIT!");
        }
 
+       /**
+        * Adds given key-value pair for any boolean to dataset instance. Both must not be null.
+        *
+        * @param key Key to set
+        * @param value Value to set
+        */
+       protected void addToDataSet (final String key, final Boolean value) {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("key={0},value={1} - CALLED!", key, value));
+
+               // Is key/value null?
+               if (key == null) {
+                       // Key is null
+                       throw new NullPointerException("key is null");
+               } else if (value == null) {
+                       // Key is null
+                       throw new NullPointerException("value is null");
+               }
+
+               // Add it to map
+               this.dataset.put(key, value);
+               
+               // Trace message
+               this.getLogger().trace("EXIT!");
+       }
+
        /**
         * Clears dataset instance. You should call this before you use it for
         * inserting data into your database.