2 * Copyright © 2020 Orange, Inc. and others. All rights reserved.
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
9 package org.opendaylight.transportpce.pce.gnpy.utils;
11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
12 import java.io.Serializable;
13 import java.util.Comparator;
14 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.ztoa.direction.ZToA;
16 @SuppressWarnings("serial")
18 value = "SE_NO_SERIALVERSIONID",
19 justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
20 public class ZToAComparator implements Comparator<ZToA>, Serializable {
23 public int compare(ZToA o1, ZToA o2) {
24 if (o1 == null && o2 == null) {
26 } else if (o1 == null) {
28 } else if (o2 == null) {
30 } else if (o1.getId() == null && o2.getId() == null) {
32 } else if (o1.getId() == null) {
34 } else if (o2.getId() == null) {
37 return Integer.valueOf(o1.getId()).compareTo(Integer.valueOf(o2.getId()));