Fixing checkstyle issues on Ashwin's initial POC code for the new Schema design.
[netvirt.git] / ovsdb / src / main / java / org / opendaylight / ovsdb / lib / database / ColumnSchema.java
1 /*\r
2  * [[ Authors will Fill in the Copyright header ]]\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  *\r
8  * Authors : Brent Salisbury, Evan Zeller\r
9  */\r
10 package org.opendaylight.ovsdb.lib.database;\r
11 \r
12 import com.fasterxml.jackson.annotation.JsonProperty;\r
13 import org.opendaylight.ovsdb.lib.notation.Condition;\r
14 import org.opendaylight.ovsdb.lib.notation.Function;\r
15 \r
16 public class ColumnSchema {\r
17 \r
18     String name;\r
19 \r
20     @JsonProperty("type")\r
21     private OvsdbType type;\r
22 \r
23     @JsonProperty("ephemeral")\r
24     private Boolean ephemeral;\r
25 \r
26     @JsonProperty("mutable")\r
27     private Boolean mutable;\r
28 \r
29     public OvsdbType getType() {\r
30         return type;\r
31     }\r
32 \r
33     public Boolean getEphemeral() {\r
34         return ephemeral;\r
35     }\r
36 \r
37     public Boolean getMutable() {\r
38         return mutable;\r
39     }\r
40 \r
41     public String getName() {\r
42         return name;\r
43     }\r
44 \r
45     public void setName(String name) {\r
46         this.name = name;\r
47     }\r
48 \r
49     public Condition opEqual(String some) {\r
50         return new Condition(this.getName(), Function.EQUALS, some);\r
51     }\r
52 \r
53     public Condition opGreaterThan(Object val) {\r
54         return new Condition(this.getName(), Function.GREATER_THAN, val);\r
55     }\r
56 \r
57     public Condition opLesserThan(int val) {\r
58         return new Condition(this.getName(), Function.GREATER_THAN, val);\r
59     }\r
60 \r
61     public Condition opLesserThanOrEquals(Object val) {\r
62         return new Condition(this.getName(), Function.LESS_THAN_OR_EQUALS, val);\r
63     }\r
64 \r
65     @Override\r
66     public String toString() {\r
67         return "ColumnType [type=" + type + ", ephemeral=" + ephemeral\r
68                 + ", mutable=" + mutable + "]";\r
69     }\r
70 \r
71 }\r