]> git.mxchange.org Git - jfinancials-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 16:18:36 +0000 (18:18 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 24 Apr 2020 16:18:36 +0000 (18:18 +0200)
- renamed added-event as this is for administrators
- added administrative updated-event for receipt items

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jfinancials/events/receipt_item/added/AdminReceiptItemAddedEvent.java [new file with mode: 0644]
src/org/mxchange/jfinancials/events/receipt_item/added/ObservableAdminReceiptItemAddedEvent.java [new file with mode: 0644]
src/org/mxchange/jfinancials/events/receipt_item/added/ObservableReceiptItemAddedEvent.java [deleted file]
src/org/mxchange/jfinancials/events/receipt_item/added/ReceiptItemAddedEvent.java [deleted file]
src/org/mxchange/jfinancials/events/receipt_item/updated/AdminReceiptItemUpdatedEvent.java [new file with mode: 0644]
src/org/mxchange/jfinancials/events/receipt_item/updated/ObservableAdminReceiptItemUpdatedEvent.java [new file with mode: 0644]

diff --git a/src/org/mxchange/jfinancials/events/receipt_item/added/AdminReceiptItemAddedEvent.java b/src/org/mxchange/jfinancials/events/receipt_item/added/AdminReceiptItemAddedEvent.java
new file mode 100644 (file)
index 0000000..fc8dbc9
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * 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.jfinancials.events.receipt_item.added;
+
+import java.text.MessageFormat;
+import org.mxchange.jfinancials.model.receipt_item.BillableReceiptItem;
+
+/**
+ * An event being fired when a new receipt item has been added by an
+ * administrator.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class AdminReceiptItemAddedEvent implements ObservableAdminReceiptItemAddedEvent {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 157_582_667_163_548L;
+
+       /**
+        * New receipt item instance being added
+        */
+       private final BillableReceiptItem addedReceiptItem;
+
+       /**
+        * Constructor with receipt instance
+        * <p>
+        * @param addedReceiptItem Receipt instance
+        */
+       public AdminReceiptItemAddedEvent (final BillableReceiptItem addedReceiptItem) {
+               // Validate parameter
+               if (null == addedReceiptItem) {
+                       // Throw NPE
+                       throw new NullPointerException("addedReceiptItem is null");
+               } else if (addedReceiptItem.getItemId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("addedReceiptItem.itemId is null");
+               } else if (addedReceiptItem.getItemId() < 1) {
+                       // Throw NPE again
+                       throw new NullPointerException(MessageFormat.format("addedReceiptItem.itemId={0} is not valid", addedReceiptItem.getItemId()));
+               }
+
+               // Set it here
+               this.addedReceiptItem = addedReceiptItem;
+       }
+
+       @Override
+       public BillableReceiptItem getAddedReceiptItem () {
+               return this.addedReceiptItem;
+       }
+
+}
diff --git a/src/org/mxchange/jfinancials/events/receipt_item/added/ObservableAdminReceiptItemAddedEvent.java b/src/org/mxchange/jfinancials/events/receipt_item/added/ObservableAdminReceiptItemAddedEvent.java
new file mode 100644 (file)
index 0000000..893af3d
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * 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.jfinancials.events.receipt_item.added;
+
+import java.io.Serializable;
+import org.mxchange.jfinancials.model.receipt_item.BillableReceiptItem;
+
+/**
+ * An interface for events being fired when a receipt item instance has been
+ * added by an administrator.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminReceiptItemAddedEvent extends Serializable {
+
+       /**
+        * Getter for added receipt item instance
+        * <p>
+        * @return Receipt item instance
+        */
+       BillableReceiptItem getAddedReceiptItem ();
+
+}
diff --git a/src/org/mxchange/jfinancials/events/receipt_item/added/ObservableReceiptItemAddedEvent.java b/src/org/mxchange/jfinancials/events/receipt_item/added/ObservableReceiptItemAddedEvent.java
deleted file mode 100644 (file)
index 0379ff7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2017 - 2020 Free Software Foundation
- *
- * 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.jfinancials.events.receipt_item.added;
-
-import java.io.Serializable;
-import org.mxchange.jfinancials.model.receipt_item.BillableReceiptItem;
-
-/**
- * An interface for events being fired when a receipt item instance has been
- * added.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface ObservableReceiptItemAddedEvent extends Serializable {
-
-       /**
-        * Getter for receipt item instance
-        * <p>
-        * @return Receipt item instance
-        */
-       BillableReceiptItem getReceiptItem ();
-
-}
diff --git a/src/org/mxchange/jfinancials/events/receipt_item/added/ReceiptItemAddedEvent.java b/src/org/mxchange/jfinancials/events/receipt_item/added/ReceiptItemAddedEvent.java
deleted file mode 100644 (file)
index 04ce960..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2017 - 2020 Free Software Foundation
- *
- * 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.jfinancials.events.receipt_item.added;
-
-import java.text.MessageFormat;
-import org.mxchange.jfinancials.model.receipt_item.BillableReceiptItem;
-
-/**
- * An event being fired when a new receipt item has been added
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public class ReceiptItemAddedEvent implements ObservableReceiptItemAddedEvent {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 157_582_667_163_548L;
-
-       /**
-        * New receipt item instance being added
-        */
-       private final BillableReceiptItem receiptItem;
-
-       /**
-        * Constructor with receipt instance
-        * <p>
-        * @param receiptItem Receipt instance
-        */
-       public ReceiptItemAddedEvent (final BillableReceiptItem receiptItem) {
-               // Validate parameter
-               if (null == receiptItem) {
-                       // Throw NPE
-                       throw new NullPointerException("receiptItem is null");
-               } else if (receiptItem.getItemId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("receiptItem.itemId is null");
-               } else if (receiptItem.getItemId() < 1) {
-                       // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("receiptItem.itemId={0} is not valid", receiptItem.getItemId()));
-               }
-
-               // Set it here
-               this.receiptItem = receiptItem;
-       }
-
-       @Override
-       public BillableReceiptItem getReceiptItem () {
-               return this.receiptItem;
-       }
-
-}
diff --git a/src/org/mxchange/jfinancials/events/receipt_item/updated/AdminReceiptItemUpdatedEvent.java b/src/org/mxchange/jfinancials/events/receipt_item/updated/AdminReceiptItemUpdatedEvent.java
new file mode 100644 (file)
index 0000000..c35879a
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * 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.jfinancials.events.receipt_item.updated;
+
+import java.text.MessageFormat;
+import org.mxchange.jfinancials.model.receipt_item.BillableReceiptItem;
+
+/**
+ * An event being fired when a new receipt item has been added by an
+ * administrator.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class AdminReceiptItemUpdatedEvent implements ObservableAdminReceiptItemUpdatedEvent {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 157_582_667_163_548L;
+
+       /**
+        * New receipt item instance being updated
+        */
+       private final BillableReceiptItem updatedReceiptItem;
+
+       /**
+        * Constructor with receipt instance
+        * <p>
+        * @param updatedReceiptItem Receipt instance
+        */
+       public AdminReceiptItemUpdatedEvent (final BillableReceiptItem updatedReceiptItem) {
+               // Validate parameter
+               if (null == updatedReceiptItem) {
+                       // Throw NPE
+                       throw new NullPointerException("updatedReceiptItem is null");
+               } else if (updatedReceiptItem.getItemId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("updatedReceiptItem.itemId is null");
+               } else if (updatedReceiptItem.getItemId() < 1) {
+                       // Throw NPE again
+                       throw new NullPointerException(MessageFormat.format("updatedReceiptItem.itemId={0} is not valid", updatedReceiptItem.getItemId()));
+               }
+
+               // Set it here
+               this.updatedReceiptItem = updatedReceiptItem;
+       }
+
+       @Override
+       public BillableReceiptItem getUpdatedReceiptItem () {
+               return this.updatedReceiptItem;
+       }
+
+}
diff --git a/src/org/mxchange/jfinancials/events/receipt_item/updated/ObservableAdminReceiptItemUpdatedEvent.java b/src/org/mxchange/jfinancials/events/receipt_item/updated/ObservableAdminReceiptItemUpdatedEvent.java
new file mode 100644 (file)
index 0000000..af7e20f
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * 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.jfinancials.events.receipt_item.updated;
+
+import java.io.Serializable;
+import org.mxchange.jfinancials.model.receipt_item.BillableReceiptItem;
+
+/**
+ * An interface for events being fired when a receipt item instance has been
+ * updated by an administrator.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableAdminReceiptItemUpdatedEvent extends Serializable {
+
+       /**
+        * Getter for updated receipt item instance
+        * <p>
+        * @return Receipt item instance
+        */
+       BillableReceiptItem getUpdatedReceiptItem ();
+
+}