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.nb.rfc8040.utils.parser;
10 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
11 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
14 * Codec for identifier to serialize {@link YangInstanceIdentifier} to
15 * {@link String} and deserialize {@link String} to
16 * {@link YangInstanceIdentifier}.
19 public final class IdentifierCodec {
21 private IdentifierCodec() {
22 throw new UnsupportedOperationException("Util class.");
25 public static String serialize(final YangInstanceIdentifier data, final EffectiveModelContext schemaContext) {
26 return YangInstanceIdentifierSerializer.create(schemaContext, data);
29 public static YangInstanceIdentifier deserialize(final String data, final EffectiveModelContext schemaContext) {
31 return YangInstanceIdentifier.builder().build();
33 return YangInstanceIdentifier.create(YangInstanceIdentifierDeserializer.create(schemaContext, data));