77f7f8c678ebe473975759791ffbb5a53706158d
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / model / SpectrumAssignment.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.model;
10
11 public class SpectrumAssignment {
12     /**
13      * Begin index for available spectrum assignment.
14      */
15     int beginIndex;
16
17     /**
18      * End index for available spectrum assignment.
19      */
20     int stopIndex;
21
22     /**
23      * True if spectrum assignement is for flexible grid, false otherwise (1.2.1 device).
24      */
25     boolean flexGrid;
26
27     public SpectrumAssignment(int beginIndex, int stopIndex) {
28         super();
29         this.beginIndex = beginIndex;
30         this.stopIndex = stopIndex;
31     }
32
33     /**
34      * Return the begin index of spectrum assignment.
35      * @return the beginIndex
36      */
37     public int getBeginIndex() {
38         return beginIndex;
39     }
40
41     /**
42      * Set the begin index of spectrum assignment.
43      * @param beginIndex the beginIndex to set
44      */
45     public void setBeginIndex(int beginIndex) {
46         this.beginIndex = beginIndex;
47     }
48
49     /**
50      * Return the end index of spectrum assignment.
51      * @return the stopIndex
52      */
53     public int getStopIndex() {
54         return stopIndex;
55     }
56
57     /**
58      * Set the stop index of spectrum assignment.
59      * @param stopIndex the stopIndex to set
60      */
61     public void setStopIndex(int stopIndex) {
62         this.stopIndex = stopIndex;
63     }
64
65     /**
66      * True if flexgrid false otherwise.
67      * @return the flexGrid
68      */
69     public boolean isFlexGrid() {
70         return flexGrid;
71     }
72
73     /**
74      * Set it to true for flexgrid, false otherwise.
75      * @param flexGrid the flexGrid to set
76      */
77     public void setFlexGrid(boolean flexGrid) {
78         this.flexGrid = flexGrid;
79     }
80
81     /*
82     * (non-Javadoc)
83     *
84     * @see java.lang.Object#toString()
85     */
86     @Override
87     public String toString() {
88         StringBuilder builder = new StringBuilder();
89         builder.append("SpectrumAssignment [beginIndex=").append(beginIndex).append(", stopIndex=").append(stopIndex)
90                 .append(", flexGrid=").append(flexGrid).append("]");
91         return builder.toString();
92     }
93 }