2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.clustering.it.provider.impl;
10 import com.google.common.base.MoreObjects;
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.clustering.it.provider.NormalizedNodeDiff;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
15 public final class DataListenerViolation {
16 private final NormalizedNode<?, ?> expected;
17 private final NormalizedNode<?, ?> actual;
18 private final long sequence;
20 DataListenerViolation(final long sequence, final NormalizedNode<?, ?> expected, final NormalizedNode<?, ?> actual) {
21 this.sequence = sequence;
22 this.expected = expected;
26 public long getSequence() {
30 public Optional<NormalizedNodeDiff> toDiff() {
31 return NormalizedNodeDiff.compute(expected, actual);
35 public String toString() {
36 return MoreObjects.toStringHelper(this).add("sequence", sequence).toString();