2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.rfc6241.model.api;
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;
16 * Represents the effect of 'get-filter-element-attributes' extension, as defined in
17 * <a href="https://tools.ietf.org/html/rfc6241">RFC6241</a>.
20 public interface GetFilterElementAttributesSchemaNode extends UnknownSchemaNode {
22 * Attempt to find a {@link GetFilterElementAttributesSchemaNode} in a parent {@link AnyxmlSchemaNode}.
24 * @param parent Parent to search
25 * @return {@link GetFilterElementAttributesSchemaNode} child, if present.
27 static Optional<GetFilterElementAttributesSchemaNode> findIn(final AnyxmlSchemaNode parent) {
28 return parent.getUnknownSchemaNodes().stream().filter(GetFilterElementAttributesSchemaNode.class::isInstance)
29 .findAny().map(GetFilterElementAttributesSchemaNode.class::cast);