]> git.mxchange.org Git - jaddressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/contact/BaseContact.java
Some more cleanups + added initial SQL dump
[jaddressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / contact / BaseContact.java
index 40326c3e27de08b6ee110462929149c809c5c555..983bdeade41b4255460ef9347e2a6f7065e61077 100644 (file)
@@ -26,7 +26,6 @@ import org.mxchange.addressbook.client.Client;
  *
  * @author Roland Haeder
  * @version 0.0
- * @since 0.0
  */
 public class BaseContact extends BaseFrameworkSystem {
 
@@ -114,7 +113,6 @@ public class BaseContact extends BaseFrameworkSystem {
         * No instances can be created of this class
         */
        protected BaseContact () {
-               super();
        }
 
        /**
@@ -629,4 +627,37 @@ public class BaseContact extends BaseFrameworkSystem {
        protected final void setBirthday (final String birthday) {
                this.birthday = birthday;
        }
+
+       /**
+        * Checks if given boolean field is available and set to same value
+        *
+        * @param columnName Column name to check
+        * @param bool Boolean value
+        * @return Whether all conditions are met
+        */
+       public boolean isValueEqual (final String columnName, final boolean bool) {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("columnName={0},bool={1} - CALLED!", columnName, bool));
+
+               // Convert column name to field name
+               String methodName = this.convertColumnNameToGetterMethod(columnName, true);
+
+               // Debug message
+               this.getLogger().debug(MessageFormat.format("field={0}", methodName));
+
+               // Init class instance
+               boolean value = this.getBooleanField(this, "BaseContact", methodName);
+
+               // Debug message
+               this.getLogger().debug(MessageFormat.format("value={0}", value));
+
+               // Compare it
+               boolean isFound = (bool == value);
+
+               // Trace message
+               this.getLogger().trace("isFound=" + isFound + " - EXIT!");
+
+               // Return result
+               return isFound;
+       }
 }