clean some compilation warnings
[transportpce.git] / tests / stubpce / src / main / java / org / opendaylight / transportpce / stubpce / topology / Resource.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 com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
12 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
13 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
14 import java.util.List;
15
16
17 /**
18  * Class to create structure of
19  * Supernode element.
20  *
21  * @author <a href="mailto:martial.coulibaly@gfi.com">Martial Coulibaly</a> on
22  *         behalf of Orange
23  */
24 @JacksonXmlRootElement(localName = "resource")
25 public class Resource {
26     /** element nodeId. */
27     @JacksonXmlProperty(localName = "node-id")
28     private String nodeId;
29     /** list of element links. */
30     @JacksonXmlElementWrapper(localName = "links")
31     @JacksonXmlProperty(localName = "link")
32     private List<String> links;
33     /** list of element LogicalConnectionPoint. */
34     @JacksonXmlElementWrapper(localName = "logical-connection-points")
35     @JacksonXmlProperty(localName = "logical-connection-point")
36     private List<LogicalConnectionPoint> lcps;
37
38
39     /**
40      * Resource constructor.
41      *
42      * @param nodeId element nodeId
43      * @param links list of element links
44      * @param lcps list of element LogicalConnectionPoint
45      */
46     public Resource(@JacksonXmlProperty(localName = "node-id") final String nodeId,
47             @JacksonXmlProperty(localName = "Reslinks") final List<String> links,
48             @JacksonXmlProperty(localName = "Reslcps") final List<LogicalConnectionPoint> lcps) {
49         this.setNodeId(nodeId);
50         this.setLinks(links);
51         this.setLpcs(lcps);
52     }
53
54     public String getNodeId() {
55         return nodeId;
56     }
57
58     public void setNodeId(String nodeId) {
59         this.nodeId = nodeId;
60     }
61
62     public List<String> getLinks() {
63         return links;
64     }
65
66     public void setLinks(List<String> links) {
67         this.links = links;
68     }
69
70     public List<LogicalConnectionPoint> getLcps() {
71         return lcps;
72     }
73
74     public void setLpcs(List<LogicalConnectionPoint> logicalConPoints) {
75         this.lcps = logicalConPoints;
76     }
77
78     @Override
79     public String toString() {
80         int index;
81         int size;
82         java.lang.String name = "Resource [";
83         java.lang.StringBuilder builder = new java.lang.StringBuilder(name);
84         if (nodeId != null) {
85             builder.append("nodeId=");
86             builder.append(nodeId);
87         }
88         index = 0;
89         size = lcps.size();
90         builder.append(", LogicalConnectionPoints [");
91         for (LogicalConnectionPoint tmp : lcps) {
92             builder.append(tmp.toString());
93             index++;
94             if (index < size) {
95                 builder.append(", ");
96             }
97         }
98         builder.append("]");
99         index = 0;
100         size = links.size();
101         builder.append(", links [");
102         for (String tmp : links) {
103             builder.append(tmp);
104             index++;
105             if (index < size) {
106                 builder.append(", ");
107             }
108         }
109         builder.append("]");
110         return builder.append(']').toString();
111
112     }
113
114 }