blob: e674e2442cd14edb5265df9fcb412f442ccc0ca8 [file] [log] [blame]
Xin Jin313708b2015-07-09 13:43:04 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Xin Jin313708b2015-07-09 13:43:04 -07003 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16package org.onosproject.net.flowobjective.impl.composition;
17
18import org.onosproject.net.flowobjective.ForwardingObjective;
19
20import java.util.ArrayList;
21import java.util.List;
22
23/**
24 * Provides an update table for Forward.
25 */
26public class ForwardUpdateTable {
27 public List<ForwardingObjective> addObjectives;
28 public List<ForwardingObjective> removeObjectives;
29
30 public ForwardUpdateTable() {
31 this.addObjectives = new ArrayList<>();
32 this.removeObjectives = new ArrayList<>();
33 }
34
35 public void addUpdateTable(ForwardUpdateTable updateTable) {
36 this.addObjectives.addAll(updateTable.addObjectives);
37 this.removeObjectives.addAll(updateTable.removeObjectives);
38 }
39
40 public List<ForwardingObjective> toForwardingObjectiveList() {
41 List<ForwardingObjective> forwardingObjectives = new ArrayList<>();
42 forwardingObjectives.addAll(this.addObjectives);
43 forwardingObjectives.addAll(this.removeObjectives);
44 return forwardingObjectives;
45 }
46}