From: Roland Häder Date: Sun, 10 May 2020 03:53:49 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4fb130efb4ecb03cfece9444cf4233d162fa726c;p=jcontacts-business-core.git Continued: - added exception constructor with full department instance Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jcontactsbusiness/exceptions/department/DepartmentNotFoundException.java b/src/org/mxchange/jcontactsbusiness/exceptions/department/DepartmentNotFoundException.java index 0efe7bb..9be1c4f 100644 --- a/src/org/mxchange/jcontactsbusiness/exceptions/department/DepartmentNotFoundException.java +++ b/src/org/mxchange/jcontactsbusiness/exceptions/department/DepartmentNotFoundException.java @@ -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 *

* @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 + *

+ * @param department Department instance + */ + public DepartmentNotFoundException (final Department department) { + // Invoke other constructor + this(department.getDepartmentId()); + } + }