fb75517b5f3396f056c2e084be4d3d306e7fe36b
[transportpce.git] / renderer / src / test / java / org / opendaylight / transportpce / renderer / stub / MountPointServiceStub.java
1 /*
2  * Copyright © 2018 Orange Systems, Inc. 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.transportpce.renderer.stub;
10
11 import java.util.Optional;
12 import org.opendaylight.mdsal.binding.api.MountPoint;
13 import org.opendaylight.mdsal.binding.api.MountPointService;
14 import org.opendaylight.yangtools.concepts.ListenerRegistration;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16
17 public class MountPointServiceStub implements MountPointService {
18
19     MountPoint returnedMountPoint;
20
21     public MountPointServiceStub(MountPoint usedMountPoint) {
22         this.returnedMountPoint = usedMountPoint;
23     }
24
25     @Override
26     public Optional<MountPoint> getMountPoint(InstanceIdentifier<?> mountPoint) {
27         if (returnedMountPoint == null) {
28             return Optional.empty();
29         }
30         return Optional.of(returnedMountPoint);
31     }
32
33     @Override
34     public <T extends MountPointListener> ListenerRegistration<T> registerListener(InstanceIdentifier<?> path,
35         T listener) {
36         return null;
37     }
38 }