/* * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.mdsal.dom.spi; import com.google.common.collect.ForwardingObject; import java.util.Collection; import java.util.Optional; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.mdsal.dom.api.DOMService; public abstract class ForwardingDOMService, E extends DOMService.Extension> extends ForwardingObject implements DOMService { @Override @SuppressWarnings("hiding") public final @Nullable T extension(final Class type) { return DOMService.super.extension(type); } @Override @SuppressWarnings("hiding") public final Optional findExtension(final Class type) { return DOMService.super.findExtension(type); } @Override public final Collection supportedExtensions() { return supportedExtensions(delegate().supportedExtensions()); } protected @NonNull Collection supportedExtensions(final @NonNull Collection extensions) { return extensions; } @Override protected abstract @NonNull T delegate(); }