Added range type to subject-feature-definition/parameter
[groupbasedpolicy.git] / groupbasedpolicy / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / flow / ActionComparator.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, 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.groupbasedpolicy.renderer.ofoverlay.flow;
10
11 import java.util.Comparator;
12
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
14
15 import com.google.common.collect.ComparisonChain;
16 import com.google.common.collect.Ordering;
17
18 public class ActionComparator implements Comparator<Action> {
19     public static final ActionComparator INSTANCE = new ActionComparator();
20
21     @Override
22     public int compare(Action arg0, Action arg1) {
23         return ComparisonChain.start()
24                 .compare(arg0.getOrder(), arg1.getOrder(), 
25                          Ordering.natural().nullsLast())
26                 .result();
27     }
28
29 }