Resolved the Serialization and Deserialization issues for MultiValued Columns with...
[ovsdb.git] / library / src / main / java / org / opendaylight / ovsdb / lib / notation / Column.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.notation;
14
15
16 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
17 import org.opendaylight.ovsdb.lib.schema.TableSchema;
18
19
20 public class Column<E extends TableSchema<E>, D> {
21
22     private ColumnSchema<E, D> schema;
23     private D data;
24
25     public Column(ColumnSchema<E, D> schema, D d) {
26         this.schema = schema;
27         this.data = d;
28     }
29
30     public <E extends TableSchema<E>, T> T getData(ColumnSchema<E, T> schema) {
31         return schema.validate(data);
32     }
33
34     public D getData() {
35         return data;
36     }
37
38     public void setData(D data) {
39         this.data = data;
40     }
41
42     public ColumnSchema<E, D> getSchema() {
43         return schema;
44     }
45
46     public void setSchema(ColumnSchema<E, D> schema) {
47         this.schema = schema;
48     }
49 }