281af9994bc5105912bac97c8000fa201b98f987
[ovsdb.git] / library / impl / src / main / java / org / opendaylight / ovsdb / lib / message / TableUpdates.java
1 /*
2  * Copyright © 2014, 2017 EBay Software Foundation and others. All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.ovsdb.lib.message;
10
11 import java.util.HashMap;
12 import java.util.Map;
13 import org.opendaylight.ovsdb.lib.schema.TableSchema;
14
15
16 public class TableUpdates extends Response {
17
18     private final Map<String, TableUpdate> map = new HashMap<>();
19
20     public TableUpdates() {}
21
22     public TableUpdates(Map<String, TableUpdate> map) {
23         this.map.putAll(map);
24     }
25
26     public <E extends TableSchema<E>> TableUpdate<E> getUpdate(TableSchema<E> table) {
27         return this.map.get(table.getName());
28     }
29
30     public Map<String, TableUpdate> getUpdates() {
31         return map;
32     }
33
34     @Override
35     public String toString() {
36         return "TableUpdates [map=" + map + ", error=" + error + ", details="
37                 + details + ", getError()=" + getError() + ", getDetails()="
38                 + getDetails() + ", getClass()=" + getClass() + ", hashCode()="
39                 + hashCode() + ", toString()=" + super.toString() + "]";
40     }
41 }