Convert SchemaExportContext to Java record
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / YangSchemaExportBodyWriter.java
index 1563793055f370070e30155a479b368bc85844b1..4738def08dbcd59ab51808fb97a4a381de2acea3 100644 (file)
@@ -32,12 +32,12 @@ public class YangSchemaExportBodyWriter extends AbstractSchemaExportBodyWriter {
     public void writeTo(final SchemaExportContext context, final Class<?> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
             final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException {
-        final Module module = context.getModule();
+        final Module module = context.module();
         final SourceIdentifier sourceId = new SourceIdentifier(module.getName(),
                 module.getQNameModule().getRevision().map(Revision::toString).orElse(null));
         final YangTextSchemaSource yangTextSchemaSource;
         try {
-            yangTextSchemaSource = context.getSourceProvider().getSource(sourceId).get();
+            yangTextSchemaSource = context.sourceProvider().getSource(sourceId).get();
         } catch (InterruptedException | ExecutionException e) {
             throw new WebApplicationException("Unable to retrieve source from SourceProvider.", e);
         }