Ignore serializable warnings after Phosphorus bump
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / gnpy / utils / ZToAComparator.java
1 /*
2  * Copyright © 2020 Orange, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.transportpce.pce.gnpy.utils;
10
11 import java.io.Serializable;
12 import java.util.Comparator;
13 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev210705.path.description.ztoa.direction.ZToA;
14
15 @SuppressWarnings("serial")
16 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
17     value = "SE_NO_SERIALVERSIONID",
18     justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
19 public class ZToAComparator implements Comparator<ZToA>, Serializable {
20
21     @Override
22     public int compare(ZToA o1, ZToA o2) {
23         if (o1 == null && o2 == null) {
24             return 0;
25         } else if (o1 == null) {
26             return 1;
27         } else if (o2 == null) {
28             return -1;
29         } else if (o1.getId() == null && o2.getId() == null) {
30             return 0;
31         } else if (o1.getId() == null) {
32             return 1;
33         } else if (o2.getId() == null) {
34             return -1;
35         } else {
36             return Integer.valueOf(o1.getId()).compareTo(Integer.valueOf(o2.getId()));
37         }
38     }
39
40 }