Cleanup checkstyle in yang-{data,model}-api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / repo / api / SchemaSourceRepresentation.java
index 90fc5ae740c2bf5cf2d07f0328681d1e1f987f07..4df8e7eb9a1525fc314cb22c93739d2a32f4ea76 100644 (file)
@@ -3,29 +3,33 @@
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/eplv10.html
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 package org.opendaylight.yangtools.yang.model.repo.api;
 
 import com.google.common.annotations.Beta;
-
+import java.util.Optional;
+import javax.annotation.Nonnull;
 import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.concepts.Immutable;
 
 /**
  * Common interface for schema source representations.
  *
+ * <p>
  * A schema source is an atomic piece of the overall schema context. In YANG terms,
  * a schema source is semantically equivalent to a single YANG text file, be it a
  * module or a submodule.
  *
+ * <p>
  * A schema source can exist in various forms, which we call representations. Again,
  * in YANG terms, each representation is semantically equivalent, but from
  * implementation perspective certain operations on a schema source may require it
  * to be first transformed into a particular representation before they can be
  * applied. Such transformations are affected via instances of
- * {@link SchemaSourceTransformation}.
+ * SchemaSourceTransformation.
  *
+ * <p>
  * Typical examples of a schema source representation include:
  * <ul>
  * <li>a {@link java.lang.String} - textual representation of source code
@@ -33,15 +37,13 @@ import org.opendaylight.yangtools.concepts.Immutable;
  * <li>a {@link com.google.common.io.ByteSource} - source for input streams
  * containing source code
  * <li>Parsed abstract syntax tree (AST), which is the result of a syntactic parser
+ * </ul>
  *
- * Implementations of this interface expected to comply with the {@link Immutable}
- * contract.
+ * <p>
+ * Implementations of this interface expected to comply with the {@link Immutable} contract.
  */
 @Beta
 public interface SchemaSourceRepresentation extends Identifiable<SourceIdentifier>, Immutable {
-    /**
-     * {@inheritDoc}
-     */
     @Override
     SourceIdentifier getIdentifier();
 
@@ -50,5 +52,15 @@ public interface SchemaSourceRepresentation extends Identifiable<SourceIdentifie
      *
      * @return The type of representation.
      */
-    Class<? extends SchemaSourceRepresentation> getType();
+    @Nonnull Class<? extends SchemaSourceRepresentation> getType();
+
+    /**
+     * Return the symbolic name, if available. This name has no semantic meaning beyond being useful for debugging
+     * by humans.
+     *
+     * @return Symbolic name, if available
+     */
+    default Optional<String> getSymbolicName() {
+        return Optional.empty();
+    }
 }