2 * Copyright (c) 2020 PANTHEON.tech, 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.mdsal.dom.spi;
10 import com.google.common.collect.ForwardingObject;
11 import java.util.Collection;
12 import java.util.Optional;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.eclipse.jdt.annotation.Nullable;
15 import org.opendaylight.mdsal.dom.api.DOMService;
17 public abstract class ForwardingDOMService<T extends DOMService<T, E>, E extends DOMService.Extension<T, E>>
18 extends ForwardingObject implements DOMService<T, E> {
20 @SuppressWarnings("hiding")
21 public final <T extends E> @Nullable T extension(final Class<T> type) {
22 return DOMService.super.extension(type);
26 @SuppressWarnings("hiding")
27 public final <T extends E> Optional<T> findExtension(final Class<T> type) {
28 return DOMService.super.findExtension(type);
32 public final Collection<? extends E> supportedExtensions() {
33 return supportedExtensions(delegate().supportedExtensions());
36 protected @NonNull Collection<? extends E> supportedExtensions(final @NonNull Collection<? extends E> extensions) {
41 protected abstract @NonNull T delegate();