X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Forg%2Fmxchange%2Fjcore%2Fcontact%2FBaseContact.java;h=71a7d30021e3531f0526a87fd5661fc1643d6fc6;hb=10598f2ffeebd25b659f61e4e528f2ec9d25f41e;hp=75f51fdf1d5ac358d1e88cd845a06ca1bf379d19;hpb=727f1eaa76befb29025efd88abf4124c6882ddee;p=jcore.git diff --git a/src/org/mxchange/jcore/contact/BaseContact.java b/src/org/mxchange/jcore/contact/BaseContact.java index 75f51fd..71a7d30 100644 --- a/src/org/mxchange/jcore/contact/BaseContact.java +++ b/src/org/mxchange/jcore/contact/BaseContact.java @@ -17,6 +17,7 @@ package org.mxchange.jcore.contact; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; import java.text.MessageFormat; import java.util.Iterator; import java.util.Map; @@ -25,7 +26,7 @@ import org.mxchange.jcore.BaseFrameworkSystem; import org.mxchange.jcore.client.Client; /** - * A general contact + * A general contact class which should only be extended. * * @author Roland Haeder * @version 0.0 @@ -113,7 +114,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { private Long zipCode; /** - * No instances can be created of this class + * No instances should be created of this class. Better extend this class + * and provide proper constructors. */ protected BaseContact () { } @@ -171,7 +173,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return the cellphoneNumber */ @Override - public String getCellphoneNumber () { + public final String getCellphoneNumber () { return this.cellphoneNumber; } @@ -265,41 +267,6 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { this.countryCode = countryCode; } - /** - * "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 - - // Get all together - String csvString = String.format( - "\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\"", //NOI18N - this.isOwnContact(), - this.getGender().getDatabaseValue(), - this.getSurname(), - this.getFamilyName(), - this.getCompanyName(), - this.getStreet(), - this.getZipCode(), - this.getCity(), - this.getCountryCode(), - this.getPhoneNumber(), - this.getFaxNumber(), - this.getCellphoneNumber(), - this.getEmailAddress(), - this.getBirthday(), - this.getComment() - ); - - // Then return it - return csvString; - } - /** * Email address * @@ -327,6 +294,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { */ @Override public String getFamilyName () { + //* NOISY-DEBUG: */ this.getLogger().trace("CALLED!"); return this.familyName; } @@ -337,6 +305,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { */ @Override public final void setFamilyName (final String familyName) { + /* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("familyName={0} - CALLED!", familyName)); this.familyName = familyName; } @@ -482,7 +451,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return Value from field */ @Override - public Object getValueFromColumn (final String columnName) throws IllegalArgumentException { + public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("columnName={0} - CALLED!", columnName)); @@ -567,7 +536,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return Whether all conditions are met */ @Override - public boolean isValueEqual (final String columnName, final boolean bool) { + public boolean isFieldValueEqual (final String columnName, final boolean bool) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("columnName={0},bool={1} - CALLED!", columnName, bool)); @@ -598,7 +567,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return An iterator */ @Override - public Iterator> iterator () { + public Iterator> iterator () throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return this.fieldIterator(this, "BaseContact"); } @@ -635,4 +604,16 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { protected final void enableFlagOwnContact () { this.ownContact = true; } + + @Override + public void setValueFromColumn (final String columnName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // Trace message + this.getLogger().trace(MessageFormat.format("columnName={0},value={1} - CALLED!", columnName, value)); + + // Call super method + this.setValueInStoreableFromColumn(this, "BaseContact", columnName, value); + + // Trace message + this.getLogger().trace("EXIT!"); + } }