Primitives to retrieve parameters from Catalog
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / catalog / PenaltiesComparator.java
1 /*
2  * Copyright © 2022 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 package org.opendaylight.transportpce.common.catalog;
9
10 import java.io.Serializable;
11 import java.util.Comparator;
12 import org.opendaylight.yang.gen.v1.http.org.openroadm.operational.mode.catalog.rev211210.operational.mode.transponder.parameters.Penalties;
13
14 @SuppressWarnings("serial")
15 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
16     value = "SE_NO_SERIALVERSIONID",
17     justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
18 public class PenaltiesComparator implements Comparator<Penalties>, Serializable {
19     @Override
20     public int compare(Penalties o1, Penalties o2) {
21         return Double.compare(o1.getUpToBoundary().doubleValue(), o2.getUpToBoundary().doubleValue());
22     }
23 }