2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.yangtools.yang.data.util.codec;
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
12 import org.opendaylight.yangtools.yang.model.api.TypeAware;
13 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
16 * A no-operation codec cache. This class is thread-safe.
18 * @author Robert Varga
20 * @param <T> Codec type
23 public final class NoopCodecCache<T> extends CodecCache<T> {
24 private static final NoopCodecCache<?> INSTANCE = new NoopCodecCache<>();
26 private NoopCodecCache() {
30 @SuppressWarnings("unchecked")
31 public static <T> NoopCodecCache<T> getInstance() {
32 return (NoopCodecCache<T>) INSTANCE;
36 <S extends SchemaNode & TypeAware> T lookupComplex(final S schema) {
41 T lookupSimple(final TypeDefinition<?> type) {
46 T getSimple(final TypeDefinition<?> type, final T codec) {
51 <S extends SchemaNode & TypeAware> T getComplex(final S schema, final T codec) {