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.Module
pertaining toSourceRepresentation
which havemodule
as its root statementSourceInfo.Submodule
pertaining toSourceRepresentation
which havesubmodule
as 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-stmts
orsubmodule-header-stmts
linkage-stmts
revision-stmts
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
SourceInfo.Builder<B extends SourceInfo.Builder<B,
I>, I extends SourceInfo> static final record
ASourceInfo
about aModuleStatement
-backed source.static final record
ASourceInfo
about asubmodule
. -
Method Summary
Modifier and TypeMethodDescriptionimports()
Return allSourceDependency.Import
dependencies.includes()
Return allSourceDependency.Include
dependencies.The set of allRevisionDateStatement
mentioned inRevisionStatement
s.sourceId()
Return theSourceIdentifier
of this source, as expressed byRootDeclaredStatement.argument()
contract coupled with the first entry inrevisions()
.ReturnYangVersion
of the source.
-
Method Details
-
sourceId
SourceIdentifier sourceId()Return theSourceIdentifier
of this source, as expressed byRootDeclaredStatement.argument()
contract coupled with the first entry inrevisions()
.- Returns:
- name of this source.
-
yangVersion
YangVersion yangVersion()ReturnYangVersion
of the source. If noYangVersionStatement
is present, this method will returnYangVersion.VERSION_1
.- Returns:
YangVersion
of the source
-
revisions
ImmutableSet<Revision> revisions()The set of allRevisionDateStatement
mentioned inRevisionStatement
s. The returned set is ordered in reverse order, i.e. newest revision is encountered first.- Returns:
- all revisions known by this source
-
imports
ImmutableSet<SourceDependency.Import> imports()Return allSourceDependency.Import
dependencies.- Returns:
- all import dependencies
-
includes
ImmutableSet<SourceDependency.Include> includes()Return allSourceDependency.Include
dependencies.- Returns:
- all include dependencies
-