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.
* 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());
+ }
+
}