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 static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import java.io.IOException;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
19 * A {@link TransactionModification} which has a data component.
21 * @author Robert Varga
24 public abstract class TransactionDataModification extends TransactionModification {
25 private final NormalizedNode<?, ?> data;
27 TransactionDataModification(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
29 this.data = requireNonNull(data);
32 public final NormalizedNode<?, ?> getData() {
37 final void writeTo(final NormalizedNodeDataOutput out) throws IOException {
39 out.writeNormalizedNode(data);