3 * * Copyright (C) 2014 EBay Software Foundation
5 * * This program and the accompanying materials are made available under the
6 * * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * * and is available at http://www.eclipse.org/legal/epl-v10.html
9 * * Authors : Ashwin Raveendran
13 package org.opendaylight.ovsdb.lib.operations;
15 import com.google.common.collect.Lists;
16 import com.google.common.collect.Maps;
17 import org.opendaylight.ovsdb.lib.notation.Condition;
18 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
19 import org.opendaylight.ovsdb.lib.schema.TableSchema;
21 import java.util.List;
24 public class Update<E extends TableSchema<E>> extends Operation<E> implements ConditionalOperation {
26 Map<String, Object> row = Maps.newHashMap();
29 List<Condition> where = Lists.newArrayList();
31 private String uuidName;
33 public Update(TableSchema<E> schema) {
34 super(schema, "update");
37 public Update<E> on(TableSchema schema){
41 public <T extends TableSchema<T>, D> Update<E> set(ColumnSchema<T, D> columnSchema, D value) {
42 columnSchema.validate(value);
43 this.row.put(columnSchema.getName(), value);
47 public Where where(Condition condition) {
48 return new Where(this);
51 public String getUuid() {
55 public void setUuid(String uuid) {
59 public String getUuidName() {
63 public void setUuidName(String uuidName) {
64 this.uuidName = uuidName;
67 public Map<String, Object> getRow() {
71 public void setRow(Map<String, Object> row) {
76 public void addCondition(Condition condition) {
77 this.where.add(condition);
80 public List<Condition> getWhere() {
84 public void setWhere(List<Condition> where) {