2 * Copyright (c) 2013, 2015 Red Hat, Inc. and others. All rights reserved.
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
9 package org.opendaylight.ovsdb.lib.notation.json;
11 import com.fasterxml.jackson.annotation.JsonTypeInfo;
12 import com.fasterxml.jackson.databind.JavaType;
13 import com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase;
14 import com.fasterxml.jackson.databind.type.TypeFactory;
16 import org.opendaylight.ovsdb.lib.notation.OvsdbSet;
17 import org.opendaylight.ovsdb.lib.notation.UUID;
19 public class OvsdbTypesIdResolver extends TypeIdResolverBase {
21 private JavaType baseType;
24 public void init(JavaType bt) {
29 public String idFromValue(Object value) {
30 throw new UnsupportedOperationException("not yet done");
34 public String idFromValueAndType(Object value, Class<?> suggestedType) {
35 throw new UnsupportedOperationException("not yet done");
39 public String idFromBaseType() {
40 throw new UnsupportedOperationException("not yet done");
44 public JavaType typeFromId(String id) {
45 if ("set".equals(id)) {
46 return TypeFactory.defaultInstance().constructCollectionType(OvsdbSet.class, Object.class);
47 } else if ("uuid".equals(id) || "named-uuid".equals(id)) {
48 return TypeFactory.defaultInstance().constructType(UUID.class);
54 public JsonTypeInfo.Id getMechanism() {
55 throw new UnsupportedOperationException("not yet done");