2 * Copyright (C) 2014 EBay Software Foundation
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 * Authors : Ashwin Raveendran
10 package org.opendaylight.ovsdb.lib.operations;
12 import com.fasterxml.jackson.annotation.JsonProperty;
13 import com.google.common.collect.Maps;
14 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
15 import org.opendaylight.ovsdb.lib.schema.TableSchema;
20 public class Insert<E extends TableSchema<E>> extends Operation<E> {
22 public static final String INSERT = "insert";
26 @JsonProperty("uuid-name")
27 private String uuidName;
29 private Map<String, Object> row = Maps.newHashMap();
31 public Insert on(TableSchema schema){
32 this.setTableSchema(schema);
36 public Insert withId(String name) {
43 public Insert(TableSchema<E> schema) {
44 super(schema, INSERT);
47 public <D, C extends TableSchema<C>> Insert<E> value(ColumnSchema<C, D> columnSchema, D value) {
48 row.put(columnSchema.getName(), value);
52 public String getUuid() {
56 public void setUuid(String uuid) {
60 public String getUuidName() {
64 public void setUuidName(String uuidName) {
65 this.uuidName = uuidName;
68 public Map<String, Object> getRow() {
72 public void setRow(Map<String, Object> row) {