X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=Addressbook%2Fsrc%2Forg%2Fmxchange%2Faddressbook%2Fcontact%2FBaseContact.java;h=4e590c2462f0420c24b658d0d48a2053e582f0a2;hb=16289838616dbf25d96a20f82164415d40181e46;hp=45d2e1787855a23e066d78a75b0ee0309bcb5a9f;hpb=b65c62081dde8af7e231a2950cdd7e36b22c6cca;p=jfinancials-lib.git diff --git a/Addressbook/src/org/mxchange/addressbook/contact/BaseContact.java b/Addressbook/src/org/mxchange/addressbook/contact/BaseContact.java index 45d2e17..4e590c2 100644 --- a/Addressbook/src/org/mxchange/addressbook/contact/BaseContact.java +++ b/Addressbook/src/org/mxchange/addressbook/contact/BaseContact.java @@ -18,8 +18,9 @@ package org.mxchange.addressbook.contact; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.addressbook.BaseFrameworkSystem; -import org.mxchange.addressbook.client.Client; +import org.mxchange.addressbook.BaseAddressbookSystem; +import org.mxchange.addressbook.client.AddressbookClient; +import org.mxchange.jcore.client.Client; /** * A general contact @@ -27,7 +28,7 @@ import org.mxchange.addressbook.client.Client; * @author Roland Haeder * @version 0.0 */ -public class BaseContact extends BaseFrameworkSystem { +public class BaseContact extends BaseAddressbookSystem { /** * Birth day @@ -236,7 +237,9 @@ public class BaseContact extends BaseFrameworkSystem { * "Serializes" this object into a CSV string (this time with semicolons) * * @return "CSV-serialized" version of the stored data + * @deprecated Don't use this anymore */ + @Deprecated public String getCsvStringFromStoreableObject () { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -412,7 +415,7 @@ public class BaseContact extends BaseFrameworkSystem { protected final void setZipCode (final long zipCode) { this.zipCode = zipCode; } - + @Override public int hashCode () { // Validate gender instance @@ -449,14 +452,17 @@ public class BaseContact extends BaseFrameworkSystem { throw new NullPointerException("client is null"); } + // Cast client + AddressbookClient c = (AddressbookClient) client; + // Display name "box" - client.displayNameBox((Contact) this); + c.displayNameBox((Contact) this); // Display address "box" - client.displayAddressBox((Contact) this); + c.displayAddressBox((Contact) this); // Display other data "box" - client.displayOtherDataBox((Contact) this); + c.displayOtherDataBox((Contact) this); } /** @@ -609,40 +615,6 @@ public class BaseContact extends BaseFrameworkSystem { 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 - */ - @Override - 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(MessageFormat.format("isFound={0} - EXIT!", isFound)); - - // Return result - return isFound; - } - /** * Some "getter for a value from given column name. This name will be * translated into a method name and then this method is called. @@ -654,26 +626,60 @@ public class BaseContact extends BaseFrameworkSystem { public Object getValueFromColumn (final String columnName) { // Trace message this.getLogger().trace(MessageFormat.format("columnName={0} - CALLED!", columnName)); - + // Determine if the given column is boolean if (this.isBooleanField(this, "BaseContact", columnName)) { // Yes, then call other method return this.getBooleanField(this, "BaseContact", columnName); } - + // Convert column name to field name String methodName = this.convertColumnNameToGetterMethod(columnName, false); - + // Debug message this.getLogger().debug(MessageFormat.format("field={0}", methodName)); - + // Get field Object value = this.getField(this, "BaseContact", methodName); - + // Trace message this.getLogger().trace("value=" + value + " - EXIT!"); - + // Return it return value; } + + /** + * 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 + */ + @Override + 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(MessageFormat.format("isFound={0} - EXIT!", isFound)); + + // Return result + return isFound; + } }