Refactored yang-maven-plugin. Updated tests.
[controller.git] / opendaylight / switchmanager / api / src / main / java / org / opendaylight / controller / switchmanager / SwitchConfig.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.switchmanager;
11
12 import java.io.Serializable;
13
14 import org.apache.commons.lang3.builder.EqualsBuilder;
15 import org.apache.commons.lang3.builder.HashCodeBuilder;
16
17 /**
18  * The class describes a switch configuration including node identifier, node
19  * name, tier number and proactive/reactive mode.
20  */
21 public class SwitchConfig implements Serializable {
22     private static final long serialVersionUID = 1L;
23     String nodeId;
24     String description;
25     String tier;
26     String mode;
27
28     public SwitchConfig(String nodeId, String description, String tier, String mode) {
29         super();
30         this.nodeId = nodeId;
31         this.description = description;
32         this.tier = tier;
33         this.mode = mode;
34     }
35
36     public String getNodeId() {
37         return nodeId;
38     }
39
40     public String getNodeDescription() {
41         return description;
42     }
43
44     public String getTier() {
45         return tier;
46     }
47
48     public String getMode() {
49         return mode;
50     }
51
52     public boolean isProactive() {
53         return Integer.parseInt(mode) != 0;
54     }
55     
56     public static long getSerialversionuid() {
57         return serialVersionUID;
58     }
59
60     @Override
61     public int hashCode() {
62         return HashCodeBuilder.reflectionHashCode(this);
63     }
64
65     @Override
66     public boolean equals(Object obj) {
67         return EqualsBuilder.reflectionEquals(this, obj);
68     }
69 }