*/
public interface Country extends Serializable {
+ /**
+ * Copies all entries from sounce country to this
+ * <p>
+ * @param sourceCountry Source country to copy from
+ */
+ void copyAll (final Country sourceCountry);
+
/**
* Getter for country code (example: 49 for Germany, 63 for Philippines)
* <p>
/**
* Setter for whether the local dial prefix is required for local calls
* <p>
- * @param countryIsLocalPrefixRequired Whether the local dial prefix is required
+ * @param countryIsLocalPrefixRequired Whether the local dial prefix is
+ * required
*/
void setCountryIsLocalPrefixRequired (final Boolean countryIsLocalPrefixRequired);
@Column (name = "country_phone_code", length = 2, nullable = false, updatable = false)
private Short countryPhoneCode;
+ @Override
+ public void copyAll (final Country sourceCountry) {
+ // Parameter should not be null
+ if (null == sourceCountry) {
+ // Throw NPE
+ throw new NullPointerException("sourceCountry is null"); //NOI18N
+ }
+
+ // Copy all
+ this.setCountryAbroadDialPrefix(sourceCountry.getCountryAbroadDialPrefix());
+ this.setCountryCode(sourceCountry.getCountryCode());
+ this.setCountryEntryCreated(sourceCountry.getCountryEntryCreated());
+ this.setCountryExternalDialPrefix(sourceCountry.getCountryExternalDialPrefix());
+ this.setCountryI18nKey(sourceCountry.getCountryI18nKey());
+ this.setCountryId(sourceCountry.getCountryId());
+ this.setCountryIsLocalPrefixRequired(sourceCountry.getCountryIsLocalPrefixRequired());
+ this.setCountryPhoneCode(sourceCountry.getCountryPhoneCode());
+ }
+
@Override
public boolean equals (final Object object) {
if (this == object) {