2 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package io.fd.honeycomb.benchmark.util;
19 import io.fd.honeycomb.translate.write.WriteContext;
20 import io.fd.honeycomb.translate.write.Writer;
21 import org.opendaylight.yangtools.yang.binding.DataObject;
22 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
24 import javax.annotation.Nonnull;
25 import javax.annotation.Nullable;
26 import javax.annotation.concurrent.NotThreadSafe;
29 * Noop writer suitable for lists as well.
32 public final class NoopWriter<T extends DataObject> implements Writer<T> {
34 private final InstanceIdentifier<T> id;
35 private long counter = 0;
37 public NoopWriter(final InstanceIdentifier<T> id) {
42 public void processModification(@Nonnull final InstanceIdentifier<? extends DataObject> id,
43 @Nullable final DataObject dataBefore,
44 @Nullable final DataObject dataAfter,
45 @Nonnull final WriteContext ctx) {
52 public InstanceIdentifier<T> getManagedDataObjectType() {
57 public String toString() {
58 return "NoopWriter{" +
59 id.getTargetType().getSimpleName() +
60 ", counter=" + counter +
65 public boolean supportsDirectUpdate() {