2 * Copyright (c) 2023 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.restconf.server.api;
10 import org.opendaylight.yangtools.yang.common.QName;
11 import org.opendaylight.yangtools.yang.common.QNameModule;
12 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
15 * Workaround for problems with invoking interface-private static methods in inner record classes. We deal with:
17 * <li>Eclipse tries to import static such references, hence we need to prefix each use, and when we do</li>
18 * <li>SpotBugs ends up reporting UPM_UNCALLED_PRIVATE_METHOD</li>
21 final class OperationsGetResultHelper {
22 private OperationsGetResultHelper() {
26 static StringBuilder appendJSON(final StringBuilder sb, final String prefix, final QName rpc) {
27 return sb.append('"').append(prefix).append(':').append(rpc.getLocalName()).append("\" : [null]");
30 static StringBuilder appendXML(final StringBuilder sb, final QName rpc) {
31 return sb.append('<').append(rpc.getLocalName()).append(' ').append("xmlns=\"").append(rpc.getNamespace())
35 static String jsonPrefix(final EffectiveModelContext modelContext, final QNameModule namespace) {
36 return modelContext.findModuleStatement(namespace).orElseThrow().argument().getLocalName();