Disconnect YangParserConfiguration.Builder from concepts 31/99331/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 17 Jan 2022 17:05:46 +0000 (18:05 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 17 Jan 2022 17:22:33 +0000 (18:22 +0100)
concepts.Builder is going away, disconnect it from yang-parser-api.

JIRA: YANGTOOLS-1327
Change-Id: I96c7a07f4589927fd4cee799a4a1ec8791d97d62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
parser/yang-parser-api/src/main/java/org/opendaylight/yangtools/yang/parser/api/YangParserConfiguration.java

index 317159120122a1b54e57c240a1ca2fdd77d91be1..3514e312934a3fc95bb3e3addfea3ba9a0a4baf1 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Objects;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.concepts.Immutable;
+import org.opendaylight.yangtools.concepts.Mutable;
 
 /**
  * A configuration of {@link YangParser} wiring for use with {@link YangParserFactory}.
@@ -74,7 +75,7 @@ public final class YangParserConfiguration implements Immutable {
         return new Builder();
     }
 
-    public static final class Builder implements org.opendaylight.yangtools.concepts.Builder<YangParserConfiguration> {
+    public static final class Builder implements Mutable {
         private ImportResolutionMode importResolutionMode = ImportResolutionMode.DEFAULT;
         private boolean retainDeclarationReferences = false;
 
@@ -82,19 +83,23 @@ public final class YangParserConfiguration implements Immutable {
             // Hidden on purpose
         }
 
-        @Override
+        /**
+         * Return a {@link YangParserConfiguration} initialized with contents of this builder.
+         *
+         * @return A YangParserConfiguration
+         */
         public YangParserConfiguration build() {
             return new YangParserConfiguration(importResolutionMode, retainDeclarationReferences);
         }
 
         @Beta
         public Builder importResolutionMode(final ImportResolutionMode newImportResolutionMode) {
-            this.importResolutionMode = requireNonNull(newImportResolutionMode);
+            importResolutionMode = requireNonNull(newImportResolutionMode);
             return this;
         }
 
         public Builder retainDeclarationReferences(final boolean newRetainDeclarationReferences) {
-            this.retainDeclarationReferences = newRetainDeclarationReferences;
+            retainDeclarationReferences = newRetainDeclarationReferences;
             return this;
         }
     }