Stubpce Update
[transportpce.git] / tests / stubpce / src / main / java / org / opendaylight / transportpce / stubpce / topology / PathDescriptionsOrdered.java
1 /*
2  * Copyright © 2017 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.stubpce.topology;
10
11 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.path.description.list.PathDescriptions;
12
13 /**
14  * class to create structure
15  * of <code>PathDescriptions</code>
16  * ordered.
17  *
18  * @author <a href="mailto:martial.coulibaly@gfi.com">Martial Coulibaly</a> on
19  *         behalf of Orange
20  */
21 public class PathDescriptionsOrdered implements Comparable<PathDescriptionsOrdered> {
22     private PathDescriptions pathDescriptions;
23     private int ord;
24
25     /**
26      * PathDescriptionsOrdered constructor.
27      *
28      * @param paths PathDescriptions
29      * @param order Integer
30      */
31     public PathDescriptionsOrdered(PathDescriptions paths, int order) {
32         setPathDescriptions(paths);
33         setOrd(order);
34     }
35
36     @Override
37     public int compareTo(PathDescriptionsOrdered paths) {
38         return this.ord - paths.getOrd();
39     }
40
41     public PathDescriptions getPathDescriptions() {
42         return pathDescriptions;
43     }
44
45     public void setPathDescriptions(PathDescriptions pathDescriptions) {
46         this.pathDescriptions = pathDescriptions;
47     }
48
49     public int getOrd() {
50         return ord;
51     }
52
53     public void setOrd(int ord) {
54         this.ord = ord;
55     }
56 }