5c020ad485359c37d8a4d750d75e8ac8c1fc2283
[yangtools.git] / yang / rfc8528-data-api / src / main / java / org / opendaylight / yangtools / rfc8528 / data / api / MountPointStreamWriter.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech 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 package org.opendaylight.yangtools.rfc8528.data.api;
9
10 import com.google.common.annotations.Beta;
11 import java.util.Optional;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchemaResolver;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension;
16
17 /**
18  * A {@link NormalizedNodeStreamWriterExtension} exposed by stream writers which can handle mount point data, notably
19  * providing the facilities to resolve a mount point schema and normalize mount point contents into a normalized
20  * structure.
21  */
22 @Beta
23 public interface MountPointStreamWriter extends NormalizedNodeStreamWriterExtension {
24     /**
25      * Attempt to acquire a {@link MountPointSchemaResolver} to resolve schemas for the purposes of interpreting this
26      * mount point. An empty result indicates the mount point is not attached.
27      *
28      * @param label Mount point label, as defined via the use of {@code mount-point} statement
29      * @return An optional handler for mount point data
30      * @throws NullPointerException if label is null
31      */
32     Optional<MountPointSchemaResolver> findMountPoint(@NonNull QName label);
33 }