X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2Ftree%2Fdata%2FNoopDataTreeCandidate.java;fp=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2Ftree%2Fdata%2FNoopDataTreeCandidate.java;h=0000000000000000000000000000000000000000;hb=cc36277f18d3efaa5635e4a64fb22490c8223ef9;hp=227684ae35ee1f6bdbc8685df670c9cc157881af;hpb=18f8f0b852694daf18e8fd034ba576d78499e0ee;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/NoopDataTreeCandidate.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/NoopDataTreeCandidate.java deleted file mode 100644 index 227684ae35..0000000000 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/NoopDataTreeCandidate.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.md.sal.dom.store.impl.tree.data; - -import java.util.Collections; - -import org.opendaylight.controller.md.sal.dom.store.impl.tree.DataTreeCandidateNode; -import org.opendaylight.controller.md.sal.dom.store.impl.tree.ModificationType; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; - -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; - -/** - * Internal utility class for an empty candidate. We instantiate this class - * for empty modifications, saving memory and processing speed. Instances - * of this class are explicitly recognized and processing of them is skipped. - */ -final class NoopDataTreeCandidate extends AbstractDataTreeCandidate { - private static final DataTreeCandidateNode ROOT = new DataTreeCandidateNode() { - @Override - public ModificationType getModificationType() { - return ModificationType.UNMODIFIED; - } - - @Override - public Iterable getChildNodes() { - return Collections.emptyList(); - } - - @Override - public PathArgument getIdentifier() { - throw new IllegalStateException("Attempted to read identifier of the no-operation change"); - } - - @Override - public Optional> getDataAfter() { - return Optional.absent(); - } - - @Override - public Optional> getDataBefore() { - return Optional.absent(); - } - }; - - protected NoopDataTreeCandidate(final InstanceIdentifier rootPath, final ModifiedNode modificationRoot) { - super(rootPath); - Preconditions.checkArgument(modificationRoot.getType() == ModificationType.UNMODIFIED); - } - - @Override - public DataTreeCandidateNode getRootNode() { - return ROOT; - } -}