2 * Copyright (c) 2016 Cisco Systems, 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
8 package org.opendaylight.restconf.parser;
10 import org.opendaylight.restconf.parser.builder.YangInstanceIdentifierDeserializer;
11 import org.opendaylight.restconf.parser.builder.YangInstanceIdentifierSerializer;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
13 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
16 * Codec for identifier to serialize {@link YangInstanceIdentifier} to
17 * {@link String} and deserialize {@link String} to
18 * {@link YangInstanceIdentifier}.
21 public final class IdentifierCodec {
23 private IdentifierCodec() {
24 throw new UnsupportedOperationException("Util class.");
27 public static String serialize(final YangInstanceIdentifier data, final SchemaContext schemaContext) {
28 return YangInstanceIdentifierSerializer.create(schemaContext, data);
31 public static YangInstanceIdentifier deserialize(final String data, final SchemaContext schemaContext) {
33 return YangInstanceIdentifier.builder().build();
35 return YangInstanceIdentifier.create(YangInstanceIdentifierDeserializer.create(schemaContext, data));