2 * Copyright (c) 2014 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.yangtools.objcache.spi;
10 import org.opendaylight.yangtools.concepts.ProductAwareBuilder;
11 import org.opendaylight.yangtools.objcache.ObjectCache;
14 * No-operation implementation of an Object Cache. This implementation
15 * does not do any caching, so it only returns the request object.
17 public final class NoopObjectCache implements ObjectCache {
18 private static final NoopObjectCache INSTANCE = new NoopObjectCache();
20 private NoopObjectCache() {
25 * Get the cache instance. Since the cache does not have any state,
26 * this method always returns a singleton instance.
28 * @return Cache instance.
30 public static NoopObjectCache getInstance() {
35 public <T> T getReference(final T object) {
40 public <B extends ProductAwareBuilder<P>, P> P getProduct(final B builder) {
41 return builder.toInstance();