libs.commons-codec.classpath=\
- ${base}/commons-codec/commons-codec-1.10.jar
-libs.commons-codec.displayName=Commons Codec 1.10
+ ${base}/commons-codec/commons-codec-1.11.jar
+libs.commons-codec.displayName=Commons Codec 1.11
libs.commons-codec.javadoc=\
- https://commons.apache.org/proper/commons-codec/archives/1.10/apidocs/
+ https://commons.apache.org/proper/commons-codec/archives/1.11/apidocs/
libs.commons-lang3.classpath=\
- ${base}/commons-lang3/commons-lang3-3.5.jar
-libs.commons-lang3.displayName=Commons Lang3 3.5
+ ${base}/commons-lang3/commons-lang3-3.7.jar
+libs.commons-lang3.displayName=Commons Lang3 3.7
libs.commons-lang3.javadoc=\
https://commons.apache.org/proper/commons-lang/javadocs/api-release/
libs.CopyLibs.classpath=\
import java.security.SecureRandom;
import java.text.MessageFormat;
+import java.util.Objects;
import java.util.Random;
import org.apache.commons.lang3.StringUtils;
import org.mxchange.jcustomercore.model.customer.Customer;
RANDOM_NUMBER_GENERATOR = new SecureRandom();
}
+ /**
+ * Compares both customer instances. This method returns -1 if second
+ * instance is null.
+ * <p>
+ * @param customer1 Customer instance 1
+ * @param customer2 Customer instance 2
+ * <p>
+ * @return Comparison value
+ */
+ public static int compare (final Customer customer1, final Customer customer2) {
+ // Check euqality, then at least first must be given
+ if (Objects.equals(customer1, customer2)) {
+ // Both are same
+ return 0;
+ } else if (null == customer1) {
+ // First is null
+ return -1;
+ } else if (null == customer2) {
+ // Second is null
+ return 1;
+ }
+
+ // Invoke compareTo() method
+ return customer1.compareTo(customer2);
+ }
+
/**
* Copies all fields from source customer to target customer instance.
* <p>