Added more ignorable files to .gitignore
[ovsdb.git] / ovsdb / src / main / java / org / opendaylight / ovsdb / lib / operations / Where.java
1 /*
2  *
3  *  * Copyright (C) 2014 EBay Software Foundation
4  *  *
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
8  *  *
9  *  * Authors : Ashwin Raveendran
10  *
11  */
12
13 package org.opendaylight.ovsdb.lib.operations;
14
15 import com.fasterxml.jackson.annotation.JsonIgnore;
16 import org.opendaylight.ovsdb.lib.notation.Condition;
17 import org.opendaylight.ovsdb.lib.notation.Function;
18 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
19
20 public class Where {
21
22     @JsonIgnore
23     ConditionalOperation operation;
24
25     public Where() {
26     }
27
28     public Where(ConditionalOperation operation) {
29         this.operation = operation;
30     }
31
32     public Where condition(Condition condition) {
33         operation.addCondition(condition);
34         return this;
35     }
36
37     public Where condition(ColumnSchema column, Function function, Object value) {
38         this.condition(new Condition(column.getName(), function, value));
39         return this;
40     }
41
42     public Where and(ColumnSchema column, Function function, Object value) {
43         condition(column, function, value);
44         return this;
45     }
46
47     public Where and(Condition condition) {
48         condition(condition);
49         return this;
50     }
51
52     public Operation operation() {
53         return (Operation) this.operation;
54     }
55
56 }