*/
package org.mxchange.jcountry.events;
-import java.io.Serializable;
+import java.text.MessageFormat;
import org.mxchange.jcountry.data.Country;
/**
- * An interface for a country being added by the administrator.
+ * An addedCountry triggered when the administrator adds a new country
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public interface AdminAddedCountryEvent extends Serializable {
+public class AdminAddedCountryEvent implements ObservableAdminAddedCountryEvent {
/**
- * Getter for added country
+ * Serial number
+ */
+ private static final long serialVersionUID = 13_856_941_875_871_769L;
+
+ /**
+ * Added country
+ */
+ private final Country addedCountry;
+
+ /**
+ * Constructor with added country
* <p>
- * @return Added country
+ * @param addedCountry Added country
*/
- Country getAddedCountry ();
+ public AdminAddedCountryEvent (final Country addedCountry) {
+ // Is all valid?
+ if (null == addedCountry) {
+ // Throw NPE
+ throw new NullPointerException("addedCountry is null"); //NOI18N
+ } else if (addedCountry.getCountryId() == null) {
+ // And again ...
+ throw new NullPointerException("addedCountry.countryId is null"); //NOI18N
+ } else if (addedCountry.getCountryId() < 1) {
+ // Id is invalid
+ throw new IllegalArgumentException(MessageFormat.format("addedCountry.countryId={0} is not valid.", addedCountry.getCountryId())); //NOI18N
+ }
+
+ // Set country
+ this.addedCountry = addedCountry;
+ }
+
+ @Override
+ public Country getAddedCountry () {
+ return this.addedCountry;
+ }
}
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcountry.events;
-
-import java.text.MessageFormat;
-import org.mxchange.jcountry.data.Country;
-
-/**
- * An addedCountry triggered when the administrator adds a new country
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class AdminEventCountryAdded implements AdminAddedCountryEvent {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 13_856_941_875_871_769L;
-
- /**
- * Added country
- */
- private final Country addedCountry;
-
- /**
- * Constructor with added country
- * <p>
- * @param addedCountry Added country
- */
- public AdminEventCountryAdded (final Country addedCountry) {
- // Is all valid?
- if (null == addedCountry) {
- // Throw NPE
- throw new NullPointerException("addedCountry is null"); //NOI18N
- } else if (addedCountry.getCountryId() == null) {
- // And again ...
- throw new NullPointerException("addedCountry.countryId is null"); //NOI18N
- } else if (addedCountry.getCountryId() < 1) {
- // Id is invalid
- throw new IllegalArgumentException(MessageFormat.format("addedCountry.countryId={0} is not valid.", addedCountry.getCountryId())); //NOI18N
- }
-
- // Set country
- this.addedCountry = addedCountry;
- }
-
- @Override
- public Country getAddedCountry () {
- return this.addedCountry;
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcountry.events;
+
+import java.io.Serializable;
+import org.mxchange.jcountry.data.Country;
+
+/**
+ * An interface for a country being added by the administrator.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminAddedCountryEvent extends Serializable {
+
+ /**
+ * Getter for added country
+ * <p>
+ * @return Added country
+ */
+ Country getAddedCountry ();
+
+}