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.notation;
16 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
17 import org.opendaylight.ovsdb.lib.schema.TableSchema;
19 import com.fasterxml.jackson.annotation.JsonIgnore;
22 public class Column<E extends TableSchema<E>, D> {
24 private ColumnSchema<E, D> schema;
27 public Column(ColumnSchema<E, D> schema, D d) {
32 public <E extends TableSchema<E>, T> T getData(ColumnSchema<E, T> schema) {
33 return schema.validate(data);
40 public void setData(D data) {
44 public ColumnSchema<E, D> getSchema() {
48 public void setSchema(ColumnSchema<E, D> schema) {
53 public String toString() {
54 return "["+schema.getName() + "=" + data + "]";
58 public int hashCode() {
61 result = prime * result + ((data == null) ? 0 : data.hashCode());
62 result = prime * result + ((schema == null) ? 0 : schema.hashCode());
67 public boolean equals(Object obj) {
72 if (getClass() != obj.getClass())
74 Column other = (Column) obj;
76 if (other.data != null)
78 } else if (!data.equals(other.data))
81 if (other.schema != null)
83 } else if (!schema.equals(other.schema))