2 * Copyright (C) 2020 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcontactsbusiness.model.basicdata;
19 import java.io.Serializable;
20 import java.util.Objects;
23 * An utilities class for basic company data
25 * @author Roland Häder<roland@mxchange.org>
27 public class BasicDataUtils implements Serializable {
32 private static final long serialVersionUID = 159_847_673_672_091L;
35 * Compares both basic company data instances. This method returns -1 if
36 * second instance is null.
38 * @param basicData1 Basic company data instance 1
39 * @param basicData2 Basic company data instance 2
41 * @return Comparison value
43 public static int compare (final BasicData basicData1, final BasicData basicData2) {
44 // Check euqality, then at least first must be given
45 if (Objects.equals(basicData1, basicData2)) {
48 } else if (null == basicData1) {
51 } else if (null == basicData2) {
56 // Invoke compareTo() method
57 return basicData1.compareTo(basicData2);
61 * Utility classes should not have instances
63 private BasicDataUtils () {
64 // Private constructor