X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fcommons%2Ffilter-valve%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ffiltervalve%2Fcors%2Fjaxb%2FInitParam.java;fp=opendaylight%2Fcommons%2Ffilter-valve%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ffiltervalve%2Fcors%2Fjaxb%2FInitParam.java;h=edc9e4560d1f6560441186a75302abb73985012e;hp=0000000000000000000000000000000000000000;hb=205310153be518be515ac0f64cc30bf0fd172905;hpb=2fffd8cdb3ed75f478b900c677bb4d97e5e91c9c diff --git a/opendaylight/commons/filter-valve/src/main/java/org/opendaylight/controller/filtervalve/cors/jaxb/InitParam.java b/opendaylight/commons/filter-valve/src/main/java/org/opendaylight/controller/filtervalve/cors/jaxb/InitParam.java new file mode 100644 index 0000000000..edc9e4560d --- /dev/null +++ b/opendaylight/commons/filter-valve/src/main/java/org/opendaylight/controller/filtervalve/cors/jaxb/InitParam.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.controller.filtervalve.cors.jaxb; + +import static com.google.common.base.Preconditions.checkState; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class InitParam { + private String paramName; + private String paramValue; + private boolean initialized; + + public synchronized void inititialize() { + checkState(initialized == false, "Already initialized"); + initialized = true; + } + + @XmlElement(name = "param-name") + public String getParamName() { + return paramName; + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } + + @XmlElement(name = "param-value") + public String getParamValue() { + return paramValue; + } + + public void setParamValue(String paramValue) { + this.paramValue = paramValue; + } + + public boolean isInitialized() { + return initialized; + } + + @Override + public String toString() { + return "{" + paramName + '=' + paramValue + "}"; + } +}