edc9e4560d1f6560441186a75302abb73985012e
[controller.git] / opendaylight / commons / filter-valve / src / main / java / org / opendaylight / controller / filtervalve / cors / jaxb / InitParam.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, 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.controller.filtervalve.cors.jaxb;
10
11 import static com.google.common.base.Preconditions.checkState;
12
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
15
16 @XmlRootElement
17 public class InitParam {
18     private String paramName;
19     private String paramValue;
20     private boolean initialized;
21
22     public synchronized void inititialize() {
23         checkState(initialized == false, "Already initialized");
24         initialized = true;
25     }
26
27     @XmlElement(name = "param-name")
28     public String getParamName() {
29         return paramName;
30     }
31
32     public void setParamName(String paramName) {
33         this.paramName = paramName;
34     }
35
36     @XmlElement(name = "param-value")
37     public String getParamValue() {
38         return paramValue;
39     }
40
41     public void setParamValue(String paramValue) {
42         this.paramValue = paramValue;
43     }
44
45     public boolean isInitialized() {
46         return initialized;
47     }
48
49     @Override
50     public String toString() {
51         return "{" + paramName + '=' + paramValue + "}";
52     }
53 }