Merge "Refactored yang-maven-plugin. Updated tests. Removed backup files."
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / PeerBandwidth.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.sal.core;
11
12 import javax.xml.bind.annotation.XmlRootElement;
13
14 /**
15  * @file   PeerBandWidth.java
16  *
17  * @brief  Class representing peer bandwidth
18  *
19  * Describes peer Bandwidth of peer element. It's intended in multiple of
20  *  bits per seconds.
21  */
22 @XmlRootElement
23 public class PeerBandwidth extends Bandwidth {
24         private static final long serialVersionUID = 1L;
25         
26         public static final String PeerBandwidthPropName = "peerBandwidth";
27         
28         public PeerBandwidth(long value) {
29                 super(PeerBandwidthPropName);
30                 this.bandwidthValue = value;
31         }
32         
33         /*
34      * Private constructor used for JAXB mapping
35      */
36     private PeerBandwidth() {
37         super(PeerBandwidthPropName);
38                 this.bandwidthValue = 0;
39     }
40
41         public PeerBandwidth clone() {
42                 return new PeerBandwidth(this.bandwidthValue);  
43     }
44         
45
46     @Override
47     public String toString() {
48         StringBuffer sb = new StringBuffer();
49         sb.append("PeerBandWidth[");
50         sb.append(super.toString());
51         sb.append("]");
52         return sb.toString();
53     }
54 }