Hide ResourceYangTextSchemaSource 81/80581/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 25 Feb 2019 13:39:10 +0000 (14:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 25 Feb 2019 14:08:23 +0000 (15:08 +0100)
Exposing a concrete subclass here makes the API design asymmetric,
because YinTestSchemaSource equivament is not exposed. Hide
ResourceYangTextSchemaSource.

Change-Id: I187a0c049cf885bdbc567ba20b55b4d278095198
JIRA: YANGTOOLS-849
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/ResourceYangTextSchemaSource.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangTextSchemaSource.java

index b00b7504662e1d55bfab6db74596b306e0e63b95..8250fedada9d6021ae033226a0420ca7f94a95c6 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.yangtools.yang.model.repo.api;
 
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.annotations.Beta;
 import com.google.common.base.MoreObjects.ToStringHelper;
 import java.io.IOException;
 import java.io.InputStream;
@@ -21,9 +20,7 @@ import org.opendaylight.yangtools.concepts.Delegator;
 /**
  * A resource-backed {@link YinTextSchemaSource}.
  */
-@Beta
-// FIXME: YANGTOOLS-849: 3.0.0: hide this class
-public final class ResourceYangTextSchemaSource extends YangTextSchemaSource implements Delegator<URL> {
+final class ResourceYangTextSchemaSource extends YangTextSchemaSource implements Delegator<URL> {
     private final @NonNull URL url;
 
     ResourceYangTextSchemaSource(final SourceIdentifier identifier, final URL url) {
index d6c8873a7fc21e57435d611db49416298fa58f71..0e521561aa6927ae7c8225e215a7903da39b961a 100644 (file)
@@ -25,8 +25,7 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Revision;
 
 /**
- * YANG text schema source representation. Exposes an RFC6020 or RFC7950 text representation
- * as an {@link InputStream}.
+ * YANG text schema source representation. Exposes an RFC6020 or RFC7950 text representation as an {@link InputStream}.
  */
 @Beta
 public abstract class YangTextSchemaSource extends ByteSource implements YangSchemaSourceRepresentation {
@@ -94,8 +93,7 @@ public abstract class YangTextSchemaSource extends ByteSource implements YangSch
      * @return A new instance.
      * @throws IllegalArgumentException if the resource does not exist or if the name has invalid format
      */
-    // FIXME: 3.0.0: YANGTOOLS-849: return YangTextSchemaSource
-    public static @NonNull ResourceYangTextSchemaSource forResource(final String resourceName) {
+    public static @NonNull YangTextSchemaSource forResource(final String resourceName) {
         return forResource(YangTextSchemaSource.class, resourceName);
     }
 
@@ -108,8 +106,7 @@ public abstract class YangTextSchemaSource extends ByteSource implements YangSch
      * @return A new instance.
      * @throws IllegalArgumentException if the resource does not exist or if the name has invalid format
      */
-    // FIXME: 3.0.0: YANGTOOLS-849: return YangTextSchemaSource
-    public static @NonNull ResourceYangTextSchemaSource forResource(final Class<?> clazz, final String resourceName) {
+    public static @NonNull YangTextSchemaSource forResource(final Class<?> clazz, final String resourceName) {
         final String fileName = resourceName.substring(resourceName.lastIndexOf('/') + 1);
         final SourceIdentifier identifier = identifierFromFilename(fileName);
         final URL url = Resources.getResource(clazz, resourceName);