Mass-migrate to java.util.Optional
[mdsal.git] / binding2 / mdsal-binding2-api / src / main / java / org / opendaylight / mdsal / binding / javav2 / api / MountPoint.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.mdsal.binding.javav2.api;
10
11 import com.google.common.annotations.Beta;
12 import java.util.Optional;
13 import org.opendaylight.mdsal.binding.javav2.spec.base.InstanceIdentifier;
14 import org.opendaylight.yangtools.concepts.Identifiable;
15
16 /**
17  * A Node can be behind a mount point. In this case, the URI has to be in format
18  * identifier/yang-ext:mount/identifier. The first identifier is the path to
19  * a mount point and the second identifier is the path to a node behind the mount point.
20  * A URI can end in a mount point itself by using identifier/yang-ext:mount.
21  */
22 @Beta
23 public interface MountPoint extends Identifiable<InstanceIdentifier<?>> {
24
25     /**
26      * Based on given service class, it returns binding service (from cache).
27      * @param service service class
28      * @param <T> service type
29      * @return optional of binding service
30      */
31     <T extends BindingService> Optional<T> getService(Class<T> service);
32 }