Bug 2192 - Part 3 - Make ovsdb library not depend on ovsdb.utils.config
[ovsdb.git] / library / src / main / java / org / opendaylight / ovsdb / lib / operations / Delete.java
1 /*
2  * Copyright (C) 2014 Red Hat Inc,
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  * Authors : Dave Tucker
9  *
10  */
11
12 package org.opendaylight.ovsdb.lib.operations;
13
14 import java.util.List;
15
16 import org.opendaylight.ovsdb.lib.notation.Condition;
17 import org.opendaylight.ovsdb.lib.schema.TableSchema;
18
19 import com.google.common.collect.Lists;
20
21 public class Delete<E extends TableSchema<E>> extends Operation<E> implements ConditionalOperation {
22
23     public static final String DELETE = "delete";
24     List<Condition> where = Lists.newArrayList();
25     Integer count;
26
27     public Delete(TableSchema<E> schema) {
28         super(schema, DELETE);
29     }
30
31     public Delete<E> on(TableSchema schema){
32         return this;
33     }
34
35     public Where where(Condition condition) {
36         where.add(condition);
37         return new Where(this);
38     }
39
40     @Override
41     public void addCondition(Condition condition) {
42         this.where.add(condition);
43     }
44
45     public List<Condition> getWhere() {
46         return where;
47     }
48
49     public void setWhere(List<Condition> where) {
50         this.where = where;
51     }
52
53     public Integer getCount() {
54         return count;
55     }
56
57     public void setCount(Integer count) {
58         this.count = count;
59     }
60 }