2 * [[ Authors will Fill in the Copyright header ]]
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
8 * Authors : Brent Salisbury, Evan Zeller
10 package org.opendaylight.ovsdb.lib.database;
\r
12 import java.util.Arrays;
\r
14 import com.fasterxml.jackson.annotation.JsonProperty;
\r
17 public class OvsdbType {
\r
18 public enum PortType {
\r
23 INTERNAL("internal");
\r
25 private PortType(String name) {
\r
29 private String name;
\r
31 public String toString() {
\r
35 public OvsdbType(String type){
\r
36 this.key = new BaseType(type);
\r
39 public OvsdbType(@JsonProperty("key") BaseType key, @JsonProperty("value") BaseType value,
\r
40 @JsonProperty("min") Integer min, @JsonProperty("max") Object max){
\r
47 public BaseType key;
\r
48 public BaseType value;
\r
52 public static class BaseType{
\r
54 public BaseType(String type){
\r
58 public BaseType(@JsonProperty("type") String type, @JsonProperty("enum") Object[] ovsdbEnum,
\r
59 @JsonProperty("minInteger") Integer minInteger, @JsonProperty("maxInteger") Integer maxInteger,
\r
60 @JsonProperty("minReal") Double minReal, @JsonProperty("maxReal") Double maxReal,
\r
61 @JsonProperty("minLength") Integer minLength, @JsonProperty("maxLength") Integer maxLength,
\r
62 @JsonProperty("refTable") String refTable, @JsonProperty("refType") String refType){
\r
64 this.ovsdbEnum = ovsdbEnum;
\r
65 this.minInteger = minInteger;
\r
66 this.maxInteger = maxInteger;
\r
67 this.minReal = minReal;
\r
68 this.maxReal = maxReal;
\r
69 this.minLength = minLength;
\r
70 this.maxLength = maxLength;
\r
71 this.refTable = refTable;
\r
72 this.refType = refType;
\r
76 public Object[] ovsdbEnum;
\r
77 public Integer minInteger;
\r
78 public Integer maxInteger;
\r
79 public Double minReal;
\r
80 public Double maxReal;
\r
81 public Integer minLength;
\r
82 public Integer maxLength;
\r
83 public String refTable;
\r
84 public String refType;
\r
86 public String toString() {
\r
87 return "BaseType [type=" + type + ", ovsdbEnum="
\r
88 + Arrays.toString(ovsdbEnum) + ", minInteger=" + minInteger
\r
89 + ", maxInteger=" + maxInteger + ", minReal=" + minReal
\r
90 + ", maxReal=" + maxReal + ", minLength=" + minLength
\r
91 + ", maxLength=" + maxLength + ", refTable=" + refTable
\r
92 + ", refType=" + refType + "]";
\r
97 public String toString() {
\r
98 return "OvsdbType [key=" + key + ", value=" + value + ", min=" + min
\r
99 + ", max=" + max + "]";
\r