/*
- * 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
*/
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>