Interface SourceInfo
- All Known Implementing Classes:
SourceInfo.Module,SourceInfo.Submodule
@NonNullByDefault
public sealed interface SourceInfo
permits SourceInfo.Module, SourceInfo.Submodule
Linkage information about a particular
SourceRepresentation. It has two specializations
SourceInfo.Modulepertaining toSourceRepresentationwhich havemoduleas its root statementSourceInfo.Submodulepertaining toSourceRepresentationwhich havesubmoduleas its root statement
This interface captures the basic metadata needed for interpretation and linkage of the source, as represented by the following ABNF constructs placed at the start of a YANG file:
module-header-stmtsorsubmodule-header-stmtslinkage-stmtsrevision-stmts
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classSourceInfo.Builder<B extends SourceInfo.Builder<B,I>, I extends SourceInfo> static final recordASourceInfoabout aModuleStatement-backed source.static final recordASourceInfoabout asubmodule. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet<SourceDependency.Import>imports()Return allSourceDependency.Importdependencies.com.google.common.collect.ImmutableSet<SourceDependency.Include>includes()Return allSourceDependency.Includedependencies.com.google.common.collect.ImmutableSet<Revision>The set of allRevisionDateStatementmentioned inRevisionStatements.sourceId()Return theSourceIdentifierof this source, as expressed byRootDeclaredStatement.argument()contract coupled with the first entry inrevisions().ReturnYangVersionof the source.
-
Method Details
-
sourceId
SourceIdentifier sourceId()Return theSourceIdentifierof this source, as expressed byRootDeclaredStatement.argument()contract coupled with the first entry inrevisions().- Returns:
- name of this source.
-
yangVersion
YangVersion yangVersion()ReturnYangVersionof the source. If noYangVersionStatementis present, this method will returnYangVersion.VERSION_1.- Returns:
YangVersionof the source
-
revisions
com.google.common.collect.ImmutableSet<Revision> revisions()The set of allRevisionDateStatementmentioned inRevisionStatements. The returned set is ordered in reverse order, i.e. newest revision is encountered first.- Returns:
- all revisions known by this source
-
imports
com.google.common.collect.ImmutableSet<SourceDependency.Import> imports()Return allSourceDependency.Importdependencies.- Returns:
- all import dependencies
-
includes
com.google.common.collect.ImmutableSet<SourceDependency.Include> includes()Return allSourceDependency.Includedependencies.- Returns:
- all include dependencies
-