From a869ce17e9696725e0ea1c287a81b50ec81005e9 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Thu, 19 Jan 2023 03:52:20 +0100
Subject: [PATCH] Continued: - implemented java.lang.Comparable<T> as this is
 later required for Primefaces   to sort in p:dataTable tag - added required
 jcore-utils project as JAR - added utilities class for skills

---
 lib/jcore-utils.jar                           | Bin 0 -> 8416 bytes
 nbproject/project.properties                  |   4 ++
 .../model/jobskill/JobPositionSkill.java      |  37 +++++++++++
 .../model/jobskill/SkillableJobPosition.java  |   2 +-
 .../mxchange/jjobs/model/skill/JobSkill.java  |  29 +++++++++
 .../mxchange/jjobs/model/skill/Skillable.java |   4 +-
 .../model/user/skills/SkillableUser.java      |   2 +-
 .../jjobs/model/user/skills/UserSkill.java    |  32 ++++++++++
 .../jjobs/model/utils/SkillUtils.java         |  59 ++++++++++++++++++
 9 files changed, 165 insertions(+), 4 deletions(-)
 create mode 100644 lib/jcore-utils.jar
 create mode 100644 src/org/mxchange/jjobs/model/utils/SkillUtils.java

diff --git a/lib/jcore-utils.jar b/lib/jcore-utils.jar
new file mode 100644
index 0000000000000000000000000000000000000000..97e8674869d4b24ed517731010615099ef93c9f9
GIT binary patch
literal 8416
zcmb_hO>7&-6@E*KqO_s>7um66TVBa_BFg*`Wye3VEQgY%n6@OVCgoHO&|pQ4sCCGt
zx?I{;S~N(JL)rlCq3xk*l0y-+hZ-$<agC-(?`eSoMbEvoXnV<}Krca?_ItBS?s7#k
zb`Swv?at17^Ua(0zV~K!`FglVCF&#k<-6q-^8NKw4=v6WvdP@ieEQRmh?bjOe}S%l
zd+qKUCc5))5Wi;E#q3gUelA}~EzU3Mrm-PvcJh|6YDU$Z)H12@0X1v-TC!VuaZ_k$
z!^_Ng>cW6JYYE*J>&cmI2tXp0IeY4Sa;pkOSHzm3o5{?&Sj%MU8Ew>Qh!3a(s)z5t
z<Dz9MJ-}DBO6kr$2HYN%d&N!NED2xN!jD_+ax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EH1R(KWix4+~LRjL{O^h;g;5kUT?bcizw*Q47~JP6Rq^
zQNEx8s$H?e9w#@Y^7w>3$gO#N#K{f>9%R?@x?)!w8NGImS9G_>vC==VQIhWAb<T6=
ze4aZyQw%J5E6X10;8XI<g5z9~rPI^CJy-|?7Xg7f+amt3@^ugsbMJ{xMHT9)5Fcbb
zBzG&u+bD;AQ($kV+6<`kH2Cri=<Y14mPtu_4#l33+bf75Qys!P-X%7x8U}J0O%9Nr
z&jiu~ASlivPI2Y|xe6fH0OUG=ECR?904!s$LJN>1vIJrvL%7=k<X98PXIrEfKzf^1
zq6cIRK-K|707wZyHUZ!^fS4^na5BaQ0gw^g?ErGz1@cG-OnpIHd;<`^2?(zN!s~$W
zEe!nzAiU{=FvMkpgfN8sd9oEkh~w0S;LmscPN~V0bxO_eBHw*aYHj4ZI5IHjyHmJ^
zD6xE92@QsE8qneUpF{wU{5Z>Z&CfB;*FaCS-S<F8l<57}d90?W@9Us{@ZhH-{$l6+
z@!-G5Ehpb@61@L#{#fE;+_t1^zi7KJdY&i_YFb5oC$8PJaP{tKS?Z!ip4<9W1!sS}
zp-Gzl+g()oj<&if<ga+n9~<YRE()CuxnEbiFM^(~UQknup?%hJ%38m!;6(Wgp{Hx6
zi!L|!1eFE97&g?s|N3iC*7UmO_d~yYyH5_D{5Mhbb(+|YgLh}Q<yX!#4IbEf%HPEy
za3|%yC7o?|d>b4kc#P$Z@^P&5D1n2QofBxc_w-bMAGLR<2?TaCJ5{r7g0;1$dKdVs
alj`;rNMnQumW&WGd*~0~k5Bo~kNyumaqGVT

literal 0
HcmV?d00001

diff --git a/nbproject/project.properties b/nbproject/project.properties
index 534590a..d109a48 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -37,6 +37,7 @@ excludes=
 file.reference.jcontacts-business-core.jar=lib/jcontacts-business-core.jar
 file.reference.jcontacts-core.jar=lib/jcontacts-core.jar
 file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar
+file.reference.jcore-utils.jar=lib/jcore-utils.jar
 file.reference.jcoreee.jar=lib/jcoreee.jar
 file.reference.jcountry-core.jar=lib/jcountry-core.jar
 file.reference.jphone-core.jar=lib/jphone-core.jar
@@ -47,12 +48,14 @@ jar.compress=false
 jar.index=${jnlp.enabled}
 javac.classpath=\
     ${file.reference.jcoreee.jar}:\
+    ${file.reference.jcore-utils.jar}:\
     ${file.reference.jcore-logger-lib.jar}:\
     ${file.reference.jcountry-core.jar}:\
     ${file.reference.jphone-core.jar}:\
     ${file.reference.juser-core.jar}:\
     ${file.reference.jcontacts-core.jar}:\
     ${file.reference.jcontacts-business-core.jar}:\
+    ${libs.commons-lang3.classpath}:\
     ${libs.jpa20-persistence.classpath}:\
     ${libs.javaee-api-7.0.classpath}
 # Space-separated list of extra javac options
@@ -125,6 +128,7 @@ source.encoding=UTF-8
 source.reference.jcontacts-business-core.jar=../jcore-business-core/src/
 source.reference.jcontacts-core.jar=../jcontacts-core/src/
 source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/
+source.reference.jcore-utils.jar=../jcore-utils/src/
 source.reference.jcoreee.jar=../jcoreee/src/
 source.reference.jcountry-core.jar=../jcountry-core/src/
 source.reference.jphone-core.jar=../jphone-core/src/
diff --git a/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java b/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java
index 410ae68..adcc4a1 100644
--- a/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java
+++ b/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java
@@ -34,10 +34,15 @@ import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 import org.mxchange.jcontactsbusiness.model.jobposition.EmployeePosition;
 import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
+import org.mxchange.jcontactsbusiness.model.utils.JobPositionUtils;
+import org.mxchange.jcoreutils.comparable.ComparableUtils;
+import org.mxchange.jcoreutils.number.SafeNumberUtils;
 import org.mxchange.jjobs.model.skill.JobSkill;
 import org.mxchange.jjobs.model.skill.Skillable;
+import org.mxchange.jjobs.model.utils.SkillUtils;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.utils.UserUtils;
 
 /**
  * A POJO entity for job position skills (linking job position and skill
@@ -157,6 +162,38 @@ public class JobPositionSkill implements SkillableJobPosition {
 		this.skillImportance = skillImportance;
 	}
 
+	@Override
+	public int compareTo (final SkillableJobPosition skillableJobPosition) {
+		// Checkparameter and return 0 if equal
+		if (null == skillableJobPosition) {
+			// Should not happen
+			throw new NullPointerException("Parameter 'skillableJobPosition' is null"); //NOI18N
+		} else if (Objects.equals(this, skillableJobPosition)) {
+			// Same object
+			return 0;
+		}
+
+		// Init comparitors
+		final int comparitors[] = {
+			// First compare job position
+			JobPositionUtils.compare(this.getJobPosition(), skillableJobPosition.getJobPosition()),
+			// ... next skill
+			SkillUtils.compare(this.getJobSkill(), skillableJobPosition.getJobSkill()),
+			// next job importance
+			SafeNumberUtils.compare(this.getSkillImportance(), skillableJobPosition.getSkillImportance()),
+			// ... next user
+			UserUtils.compare(this.getSkillAddedUser(), skillableJobPosition.getSkillAddedUser()),
+			// ... next primary key
+			SafeNumberUtils.compare(this.getJobPositionSkillId(), skillableJobPosition.getJobPositionSkillId())
+		};
+
+		// Check all values
+		final int comparison = ComparableUtils.checkAll(comparitors);
+
+		// Return value
+		return comparison;
+	}
+
 	@Override
 	public boolean equals (final Object object) {
 		if (this == object) {
diff --git a/src/org/mxchange/jjobs/model/jobskill/SkillableJobPosition.java b/src/org/mxchange/jjobs/model/jobskill/SkillableJobPosition.java
index 0287898..de28f03 100644
--- a/src/org/mxchange/jjobs/model/jobskill/SkillableJobPosition.java
+++ b/src/org/mxchange/jjobs/model/jobskill/SkillableJobPosition.java
@@ -27,7 +27,7 @@ import org.mxchange.jusercore.model.user.User;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public interface SkillableJobPosition extends Serializable {
+public interface SkillableJobPosition extends Comparable<SkillableJobPosition>, Serializable {
 
 	/**
 	 * Getter for job position skill id number
diff --git a/src/org/mxchange/jjobs/model/skill/JobSkill.java b/src/org/mxchange/jjobs/model/skill/JobSkill.java
index 963b744..f479d10 100644
--- a/src/org/mxchange/jjobs/model/skill/JobSkill.java
+++ b/src/org/mxchange/jjobs/model/skill/JobSkill.java
@@ -30,6 +30,9 @@ import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
+import org.apache.commons.lang3.StringUtils;
+import org.mxchange.jcoreutils.comparable.ComparableUtils;
+import org.mxchange.jcoreutils.enums.EnumUtils;
 import org.mxchange.jjobs.model.skill.status.SkillStatus;
 
 /**
@@ -129,6 +132,32 @@ public class JobSkill implements Skillable {
 		this.skillStatus = skillStatus;
 	}
 
+	@Override
+	public int compareTo (final Skillable skill) {
+		// Checkparameter and return 0 if equal
+		if (null == skill) {
+			// Should not happen
+			throw new NullPointerException("Parameter 'skill' is null"); //NOI18N
+		} else if (Objects.equals(this, skill)) {
+			// Same object
+			return 0;
+		}
+
+		// Init comparitors
+		final int comparitors[] = {
+			// First compare status
+			EnumUtils.compare(this.getSkillStatus(), skill.getSkillStatus()),
+			// ... next name
+			StringUtils.compare(this.getSkillName(), skill.getSkillName())
+		};
+
+		// Check all values
+		final int comparison = ComparableUtils.checkAll(comparitors);
+
+		// Return value
+		return comparison;
+	}
+
 	@Override
 	public boolean equals (final Object object) {
 		if (this == object) {
diff --git a/src/org/mxchange/jjobs/model/skill/Skillable.java b/src/org/mxchange/jjobs/model/skill/Skillable.java
index 3628562..3ebc780 100644
--- a/src/org/mxchange/jjobs/model/skill/Skillable.java
+++ b/src/org/mxchange/jjobs/model/skill/Skillable.java
@@ -16,16 +16,16 @@
  */
 package org.mxchange.jjobs.model.skill;
 
-import org.mxchange.jjobs.model.skill.status.SkillStatus;
 import java.io.Serializable;
 import java.util.Date;
+import org.mxchange.jjobs.model.skill.status.SkillStatus;
 
 /**
  * A POJI for skills (hard and soft)
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public interface Skillable extends Serializable {
+public interface Skillable extends Comparable<Skillable>, Serializable {
 
 	/**
 	 * Getter for skill id
diff --git a/src/org/mxchange/jjobs/model/user/skills/SkillableUser.java b/src/org/mxchange/jjobs/model/user/skills/SkillableUser.java
index 3f2116f..00512f3 100644
--- a/src/org/mxchange/jjobs/model/user/skills/SkillableUser.java
+++ b/src/org/mxchange/jjobs/model/user/skills/SkillableUser.java
@@ -26,7 +26,7 @@ import org.mxchange.jusercore.model.user.User;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public interface SkillableUser extends Serializable {
+public interface SkillableUser extends Comparable<SkillableUser>, Serializable {
 
 	/**
 	 * Getter for user skill id number
diff --git a/src/org/mxchange/jjobs/model/user/skills/UserSkill.java b/src/org/mxchange/jjobs/model/user/skills/UserSkill.java
index aa089b3..87d37cc 100644
--- a/src/org/mxchange/jjobs/model/user/skills/UserSkill.java
+++ b/src/org/mxchange/jjobs/model/user/skills/UserSkill.java
@@ -31,10 +31,14 @@ import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
+import org.mxchange.jcoreutils.comparable.ComparableUtils;
+import org.mxchange.jcoreutils.number.SafeNumberUtils;
 import org.mxchange.jjobs.model.skill.JobSkill;
 import org.mxchange.jjobs.model.skill.Skillable;
+import org.mxchange.jjobs.model.utils.SkillUtils;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.utils.UserUtils;
 
 /**
  * A POJO entity for user skills
@@ -133,6 +137,34 @@ public class UserSkill implements SkillableUser {
 		this.skillUser = skillUser;
 	}
 
+	@Override
+	public int compareTo (final SkillableUser user) {
+		// Checkparameter and return 0 if equal
+		if (null == user) {
+			// Should not happen
+			throw new NullPointerException("Parameter 'user' is null"); //NOI18N
+		} else if (Objects.equals(this, user)) {
+			// Same object
+			return 0;
+		}
+
+		// Init comparitors
+		final int comparitors[] = {
+			// First compare user
+			UserUtils.compare(this.getSkillUser(), user.getSkillUser()),
+			// Next skill
+			SkillUtils.compare(this.getJobSkill(), user.getJobSkill()),
+			// Primary key
+			SafeNumberUtils.compare(this.getUserSkillId(), user.getUserSkillId())
+		};
+
+		// Check all values
+		final int comparison = ComparableUtils.checkAll(comparitors);
+
+		// Return value
+		return comparison;
+	}
+
 	@Override
 	public boolean equals (final Object object) {
 		if (this == object) {
diff --git a/src/org/mxchange/jjobs/model/utils/SkillUtils.java b/src/org/mxchange/jjobs/model/utils/SkillUtils.java
new file mode 100644
index 0000000..0549b65
--- /dev/null
+++ b/src/org/mxchange/jjobs/model/utils/SkillUtils.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2023 Roland Häder<roland@mxchange.org>
+ *
+ * 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.jjobs.model.utils;
+
+import java.util.Objects;
+import org.mxchange.jjobs.model.skill.Skillable;
+
+/**
+ * Utilities class for skills to learn and practice
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class SkillUtils {
+
+	/**
+	 * Compares two skills with each other
+	 * <p>
+	 * @param skill1 Skill instance 1
+	 * @param skill2 Skill instance 2
+	 * <p>
+	 * @return Comparison value
+	 */
+	public static int compare (final Skillable skill1, final Skillable skill2) {
+		// Check equality, then at least first must be given
+		if (Objects.equals(skill1, skill2)) {
+			// Both are same
+			return 0;
+		} else if (null == skill1) {
+			// First is null
+			return -1;
+		} else if (null == skill2) {
+			// Second is null
+			return 1;
+		}
+
+		// Invoke compare() method
+		return skill1.compareTo(skill2);
+	}
+
+	/**
+	 * Utilities classes don't have constructors
+	 */
+	private SkillUtils () {
+	}
+}
-- 
2.39.5