import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yangtools.odlext.model.api.ContextReferenceEffectiveStatement;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.RpcEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
* @return A {@link ContentRoutedRpcContext}, or {@code null} if the RPC does not contain context information
*/
public static @Nullable ContentRoutedRpcContext forRpc(final RpcEffectiveStatement rpc) {
- final var input = rpc.findFirstEffectiveSubstatement(InputEffectiveStatement.class)
- .orElseThrow(() -> new IllegalArgumentException("Cannot find input in " + rpc));
-
- for (var stmt : input.effectiveSubstatements()) {
+ for (var stmt : rpc.input().effectiveSubstatements()) {
// TODO: LeafEffectiveStatement instead? Because that is what we are promising for #leaf()'s QName
if (stmt instanceof SchemaTreeEffectiveStatement<?> schemaStmt) {
final var context =
}
}
}
-
return null;
}
}