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
9 package org.opendaylight.openflowplugin.applications.frsync.util;
11 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
15 * Data entry of before and after data for syncup in {@link org.opendaylight.openflowplugin.applications.frsync.SyncReactor}.
17 public class SyncupEntry {
18 private final FlowCapableNode after;
19 private final LogicalDatastoreType dsTypeAfter;
20 private final FlowCapableNode before;
21 private final LogicalDatastoreType dsTypeBefore;
23 public SyncupEntry(final FlowCapableNode after, final LogicalDatastoreType dsTypeAfter,
24 final FlowCapableNode before, final LogicalDatastoreType dsTypeBefore) {
26 this.dsTypeAfter = dsTypeAfter;
28 this.dsTypeBefore = dsTypeBefore;
31 public FlowCapableNode getAfter() {
35 public FlowCapableNode getBefore() {
39 public LogicalDatastoreType getDsTypeAfter() {
43 public LogicalDatastoreType getDsTypeBefore() {
47 public boolean isOptimizedConfigDelta() {
48 return dsTypeAfter == LogicalDatastoreType.CONFIGURATION && dsTypeBefore == LogicalDatastoreType.CONFIGURATION;
52 public boolean equals(Object o) {
53 if (this == o) return true;
54 if (o == null || getClass() != o.getClass()) return false;
56 SyncupEntry that = (SyncupEntry) o;
58 if (after != null ? !after.equals(that.after) : that.after != null) return false;
59 if (dsTypeAfter != that.dsTypeAfter) return false;
60 if (before != null ? !before.equals(that.before) : that.before != null) return false;
61 return dsTypeBefore == that.dsTypeBefore;