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 javax.annotation.Nonnull;
11 import org.opendaylight.yangtools.concepts.ProductAwareBuilder;
12 import org.opendaylight.yangtools.objcache.ObjectCache;
15 * No-operation implementation of an Object Cache. This implementation
16 * does not do any caching, so it only returns the request object.
18 public final class NoopObjectCache implements ObjectCache {
19 private static final NoopObjectCache INSTANCE = new NoopObjectCache();
21 private NoopObjectCache() {
26 * Get the cache instance. Since the cache does not have any state,
27 * this method always returns a singleton instance.
29 * @return Cache instance.
31 public static NoopObjectCache getInstance() {
36 public <T> T getReference(final T object) {
41 public <B extends ProductAwareBuilder<P>, P> P getProduct(@Nonnull final B builder) {
42 return builder.build();