Populate data/ hierarchy
[yangtools.git] / yang / rfc6241-model-api / src / main / java / org / opendaylight / yangtools / rfc6241 / model / api / GetFilterElementAttributesSchemaNode.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.rfc6241.model.api;
9
10 import com.google.common.annotations.Beta;
11 import java.util.Optional;
12 import org.opendaylight.yangtools.yang.model.api.AnyxmlSchemaNode;
13 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
14
15 /**
16  * Represents the effect of 'get-filter-element-attributes' extension, as defined in
17  * <a href="https://tools.ietf.org/html/rfc6241">RFC6241</a>.
18  */
19 @Beta
20 public interface GetFilterElementAttributesSchemaNode extends UnknownSchemaNode {
21     /**
22      * Attempt to find a {@link GetFilterElementAttributesSchemaNode} in a parent {@link AnyxmlSchemaNode}.
23      *
24      * @param parent Parent to search
25      * @return {@link GetFilterElementAttributesSchemaNode} child, if present.
26      */
27     static Optional<GetFilterElementAttributesSchemaNode> findIn(final AnyxmlSchemaNode parent) {
28         return parent.getUnknownSchemaNodes().stream().filter(GetFilterElementAttributesSchemaNode.class::isInstance)
29                 .findAny().map(GetFilterElementAttributesSchemaNode.class::cast);
30     }
31
32     @Override
33     GetFilterElementAttributesEffectiveStatement asEffectiveStatement();
34 }