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 java.util.LinkedHashSet;
15 * Holder for items to be pushed to device.
16 * Contains two sets of groups -set of items to be pushed and set of tuples for update.
18 public class ItemSyncBox<I> {
20 private final Set<I> itemsToPush = new LinkedHashSet<>();
21 private final Set<ItemUpdateTuple<I>> itemsToUpdate = new LinkedHashSet<>();
23 public Set<I> getItemsToPush() {
27 public Set<ItemUpdateTuple<I>> getItemsToUpdate() {
31 public boolean isEmpty() {
32 return itemsToPush.isEmpty() && itemsToUpdate.isEmpty();
36 * Tuple holder for original and updated item.
37 * @param <I> basic type
39 public static final class ItemUpdateTuple<I> {
40 private final I original;
41 private final I updated;
43 public ItemUpdateTuple(I original, I updated) {
44 this.original = original;
45 this.updated = updated;
48 public I getOriginal() {
52 public I getUpdated() {