2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.access.commands;
10 import com.google.common.annotations.Beta;
11 import com.google.common.base.Preconditions;
12 import java.io.IOException;
13 import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataOutput;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
18 * A {@link TransactionModification} which has a data component.
20 * @author Robert Varga
23 public abstract class TransactionDataModification extends TransactionModification {
24 private final NormalizedNode<?, ?> data;
26 TransactionDataModification(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
28 this.data = Preconditions.checkNotNull(data);
31 public final NormalizedNode<?, ?> getData() {
36 final void writeTo(final NormalizedNodeDataOutput out) throws IOException {
38 out.writeNormalizedNode(data);