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;
15 import org.opendaylight.ovsdb.lib.notation.OvsdbSet;
16 import org.opendaylight.ovsdb.lib.notation.UUID;
18 public class OvsdbTypesIdResolver extends TypeIdResolverBase {
20 private JavaType baseType;
23 public void init(JavaType bt) {
28 public String idFromValue(Object value) {
29 throw new UnsupportedOperationException("not yet done");
33 public String idFromValueAndType(Object value, Class<?> suggestedType) {
34 throw new UnsupportedOperationException("not yet done");
38 public String idFromBaseType() {
39 throw new UnsupportedOperationException("not yet done");
43 public JavaType typeFromId(String id) {
44 if ("set".equals(id)) {
45 return TypeFactory.defaultInstance().constructCollectionType(OvsdbSet.class, Object.class);
46 } else if ("uuid".equals(id) || "named-uuid".equals(id)) {
47 return TypeFactory.defaultInstance().constructType(UUID.class);
53 public JsonTypeInfo.Id getMechanism() {
54 throw new UnsupportedOperationException("not yet done");