]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 10 May 2020 03:53:49 +0000 (05:53 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 10 May 2020 03:53:49 +0000 (05:53 +0200)
- added exception constructor with full department instance

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/exceptions/department/DepartmentNotFoundException.java

index 0efe7bb55e5f2dd854aac17e3adab098521494c9..9be1c4f5582de7df38783686cde8c36748c5044b 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jcontactsbusiness.exceptions.department;
 
 import java.text.MessageFormat;
+import org.mxchange.jcontactsbusiness.model.department.Department;
 
 /**
  * An exception thrown when a company department (entity) has not found.
@@ -44,11 +45,21 @@ public class DepartmentNotFoundException extends Exception {
         * Constructor with company department id and causing exception
         * <p>
         * @param departmentId Company department id
-        * @param cause          Causing exception
+        * @param cause        Causing exception
         */
        public DepartmentNotFoundException (final Long departmentId, final Throwable cause) {
                // Call super constructor with message and cause
                super(MessageFormat.format("Company department with id {0} was not found.", departmentId), cause); //NOI18N
        }
 
+       /**
+        * Constructor with full department instance
+        * <p>
+        * @param department Department instance
+        */
+       public DepartmentNotFoundException (final Department department) {
+               // Invoke other constructor
+               this(department.getDepartmentId());
+       }
+
 }