X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-model-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fmodel%2Frepo%2Fapi%2FSchemaSourceRepresentation.java;h=4df8e7eb9a1525fc314cb22c93739d2a32f4ea76;hb=3528dca5dec207aea587b846c2126a6b9bfecaf6;hp=053fe79b345eb8b12d2dc2d3d64c8b1b984d2048;hpb=9a63295d0942fbb81837d54bff35a83ec0b0263b;p=yangtools.git diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaSourceRepresentation.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaSourceRepresentation.java index 053fe79b34..4df8e7eb9a 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaSourceRepresentation.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaSourceRepresentation.java @@ -8,16 +8,20 @@ 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. * + *

* 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. * + *

* 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 @@ -25,6 +29,7 @@ import org.opendaylight.yangtools.concepts.Immutable; * applied. Such transformations are affected via instances of * SchemaSourceTransformation. * + *

* Typical examples of a schema source representation include: *

* - * Implementations of this interface expected to comply with the {@link Immutable} - * contract. + *

+ * Implementations of this interface expected to comply with the {@link Immutable} contract. */ @Beta public interface SchemaSourceRepresentation extends Identifiable, Immutable { - /** - * {@inheritDoc} - */ @Override SourceIdentifier getIdentifier(); @@ -50,5 +52,15 @@ public interface SchemaSourceRepresentation extends Identifiable getType(); + @Nonnull Class 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 getSymbolicName() { + return Optional.empty(); + } }