import org.opendaylight.ovsdb.lib.schema.TableSchema;
public class TableUpdate<E extends TableSchema<E>> {
-
private UUID uuid;
private Row<E> old;
private Row<E> new_;
public void setNew(Row<E> new_) {
this.new_ = new_;
}
+
+ @Override
+ public String toString() {
+ return "TableUpdate [uuid=" + uuid + ", old=" + old + ", new_=" + new_
+ + "]";
+ }
}
*/
package org.opendaylight.ovsdb.lib.schema;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.google.common.collect.Sets;
+import java.util.Set;
+
import org.opendaylight.ovsdb.lib.notation.UUID;
-import java.util.Set;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.collect.Sets;
public abstract class BaseType<E extends BaseType<E>> {
long max = Long.MAX_VALUE;
Set<Integer> enums;
+ @Override
public IntegerBaseType fromString(String typeString) {
return "integer".equals(typeString) ? new IntegerBaseType() : null;
}
double max = Double.MAX_VALUE;
Set<Double> enums;
+ @Override
public RealBaseType fromString(String typeString) {
return "real".equals(typeString) ? new RealBaseType() : null;
}
public static class BooleanBaseType extends BaseType {
+ @Override
public BooleanBaseType fromString(String typeString) {
return "boolean".equals(typeString) ? new BooleanBaseType() : null;
}
int maxLength = Integer.MAX_VALUE;
Set<String> enums;
+ @Override
public StringBaseType fromString(String typeString) {
return "string".equals(typeString) ? new StringBaseType() : null;
}
this.enums = enums;
}
+ @Override
public String toString() {
return "StringBaseType";
}
RefType refType;
+ @Override
public UuidBaseType fromString(String typeString) {
return "uuid".equals(typeString) ? new UuidBaseType() : null;
}
@Override
public Object toValue(JsonNode value) {
- return new UUID(value.asText());
+ if(value.isArray()) {
+ if (value.size() == 2) {
+ if (value.get(0).isTextual() && "uuid".equals(value.get(0).asText())) {
+ return new UUID(value.get(1).asText());
+ }
+ }
+ }
+ return null;
}
@Override
this.refType = refType;
}
+ @Override
public String toString() {
return "UuidBaseType";
}