]> git.mxchange.org Git - jphone-core.git/blobdiff - src/org/mxchange/jphone/model/utils/LandLineNumberUtils.java
Updated copyright year
[jphone-core.git] / src / org / mxchange / jphone / model / utils / LandLineNumberUtils.java
index 89fc25ec4fa9521643e426f62c4e8e4cdf9077d6..86bb46047e44587462e8a55258598e3b62927f4d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 - 2022 Free Software Foundation
+ * Copyright (C) 2017 - 2024 Free Software Foundation
  *
  * 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
@@ -32,6 +32,31 @@ public class LandLineNumberUtils implements Serializable {
         */
        private static final long serialVersionUID = 18_698_467_372_167_561L;
 
+       /**
+        * Compares two mobile number instances with each other
+        * <p>
+        * @param landLineNumber1 First instance of a DialableLandLineNumber class
+        * @param landLineNumber2 Second instance of a DialableLandLineNumber class
+        * <p>
+        * @return Comparison value
+        */
+       public static int compare (final DialableLandLineNumber landLineNumber1, final DialableLandLineNumber landLineNumber2) {
+               // Check equality, then at least first must be given
+               if (Objects.equals(landLineNumber1, landLineNumber2)) {
+                       // Both are same
+                       return 0;
+               } else if (null == landLineNumber1) {
+                       // First is null
+                       return -1;
+               } else if (null == landLineNumber2) {
+                       // Second is null
+                       return 1;
+               }
+
+               // Invoke compareTo() method
+               return landLineNumber1.compareTo(landLineNumber2);
+       }
+
        /**
         * Copy all fields from source object to this
         * <p>