X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Fmapping%2Fattributes%2Ffromxml%2FAttributeConfigElement.java;fp=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Fmapping%2Fattributes%2Ffromxml%2FAttributeConfigElement.java;h=0000000000000000000000000000000000000000;hb=23fe9ca678ada6263fec5dd996f4025e4a32fcf5;hp=fac1b358ce52365850bd05c861a8c751bc9c6503;hpb=071a641d7c12c0e6112d5ce0afe806b54f116ed2;p=controller.git diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AttributeConfigElement.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AttributeConfigElement.java deleted file mode 100644 index fac1b358ce..0000000000 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AttributeConfigElement.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2013 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.netconf.confignetconfconnector.mapping.attributes.fromxml; - -import com.google.common.base.Optional; -import javax.management.openmbean.OpenType; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.resolving.AttributeResolvingStrategy; -import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditStrategyType; - -/** - * Parsed xml element containing configuration for one attribute of an instance - * of some module. Contains default value extracted from yang file. - */ -public class AttributeConfigElement { - private final Object defaultValue; - private final Object value; - private final Optional editStrategy; - - private Optional resolvedValue; - private Object resolvedDefaultValue; - private String jmxName; - - public AttributeConfigElement(Object defaultValue, Object value, final EditStrategyType editStrategyType) { - this.defaultValue = defaultValue; - this.value = value; - this.editStrategy = Optional.fromNullable(editStrategyType); - } - - public void setJmxName(String jmxName) { - this.jmxName = jmxName; - } - - public String getJmxName() { - return jmxName; - } - - public void resolveValue(AttributeResolvingStrategy> attributeResolvingStrategy, - String attrName) throws NetconfDocumentedException { - resolvedValue = attributeResolvingStrategy.parseAttribute(attrName, value); - Optional resolvedDefault = attributeResolvingStrategy.parseAttribute(attrName, defaultValue); - resolvedDefaultValue = resolvedDefault.isPresent() ? resolvedDefault.get() : null; - } - - public Optional getEditStrategy() { - return editStrategy; - } - - public static AttributeConfigElement create(Object nullableDefault, Object value) { - return new AttributeConfigElement(nullableDefault, value, null); - } - - public static AttributeConfigElement createNullValue(Object nullableDefault) { - return new AttributeConfigElement(nullableDefault, null, null); - } - - public static AttributeConfigElement create(final String nullableDefault, final Object value, final EditStrategyType editStrategyType) { - return new AttributeConfigElement(nullableDefault, value, editStrategyType); - } - - public Object getValue() { - return value; - } - - public Object getDefaultValue() { - return defaultValue; - } - - public Optional getResolvedValue() { - return resolvedValue; - } - - public Object getResolvedDefaultValue() { - return resolvedDefaultValue; - } - - @Override - public String toString() { - return "AttributeConfigElement [defaultValue=" + defaultValue + ", value=" + value + "]"; - } - -}