8cd82f1e1713d964ecd87810c8d77c3fac9402b1
[ovsdb.git] / ovsdb / src / main / java / org / opendaylight / ovsdb / plugin / L4PortProperty.java
1 /*
2  * Copyright (C) 2013 Red Hat, Inc.
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  * Authors : Madhu Venugopal, Brent Salisbury
9  */
10
11 package org.opendaylight.ovsdb.plugin;
12
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
17
18 import org.opendaylight.controller.sal.core.Property;
19
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22 public class L4PortProperty extends Property implements Cloneable {
23     private static final long serialVersionUID = 1L;
24     @XmlElement(name="value")
25     private final int port;
26     public static final String name = "Port";
27
28     /*
29      * Private constructor used for JAXB mapping
30      */
31     private L4PortProperty() {
32         super(name);
33         this.port = 0;
34     }
35
36     public L4PortProperty(int port) {
37         super(name);
38         this.port = port;
39     }
40
41     @Override
42     public String getStringValue() {
43         return port+"";
44     }
45
46     @Override
47     public Property clone() {
48         return new L4PortProperty(port);
49     }
50
51     public int getPort() {
52         return port;
53     }
54 }