Class AbstractEffectiveModule<D extends DeclaredStatement<UnqualifiedQName>,E extends DataTreeAwareEffectiveStatement<UnqualifiedQName,D>>
- java.lang.Object
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveStatement<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.WithSchemaTree<A,D,E>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.WithDataTree<A,D,E>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.DefaultWithDataTree<A,D,E>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.DefaultWithDataTree.WithSubstatements<UnqualifiedQName,D,E>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveModule<D,E>
-
- All Implemented Interfaces:
Immutable
,MutationBehaviour<Immutable>
,DataNodeContainer
,DocumentedNode
,EffectiveStatement<UnqualifiedQName,D>
,ModelStatement<UnqualifiedQName>
,ModuleLike
,NotificationNodeContainer
,QNameModuleAware
,NotificationNodeContainerCompat<UnqualifiedQName,D,E>
,SchemaTreeAwareEffectiveStatement<UnqualifiedQName,D>
,EffectiveStatementMixins.DocumentedNodeMixin<UnqualifiedQName,D>
@Beta public abstract class AbstractEffectiveModule<D extends DeclaredStatement<UnqualifiedQName>,E extends DataTreeAwareEffectiveStatement<UnqualifiedQName,D>> extends AbstractDeclaredEffectiveStatement.DefaultWithDataTree.WithSubstatements<UnqualifiedQName,D,E> implements ModuleLike, EffectiveStatementMixins.DocumentedNodeMixin<UnqualifiedQName,D>, NotificationNodeContainerCompat<UnqualifiedQName,D,E>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.DefaultWithDataTree
AbstractDeclaredEffectiveStatement.DefaultWithDataTree.WithSubstatements<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>
-
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement
AbstractDeclaredEffectiveStatement.Default<A,D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultArgument<A,D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultDataNodeContainer<A,D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultWithArgument<A,D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultWithDataTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>, AbstractDeclaredEffectiveStatement.DefaultWithSchemaTree<A,D extends DeclaredStatement<A>,E extends SchemaTreeAwareEffectiveStatement<A,D>>, AbstractDeclaredEffectiveStatement.WithDataTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>, AbstractDeclaredEffectiveStatement.WithSchemaTree<A,D extends DeclaredStatement<A>,E extends SchemaTreeAwareEffectiveStatement<A,D>>
-
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.yang.model.api.DocumentedNode
DocumentedNode.WithStatus
-
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMixins.DocumentedNodeMixin
EffectiveStatementMixins.DocumentedNodeMixin.WithStatus<A,D extends DeclaredStatement<A>>
-
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement
SchemaTreeAwareEffectiveStatement.Namespace<T extends SchemaTreeEffectiveStatement<?>>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractEffectiveModule(D declared, StmtContext<UnqualifiedQName,D,? extends EffectiveStatement<UnqualifiedQName,?>> ctx, ImmutableList<? extends EffectiveStatement<?,?>> substatements, String prefix)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendPrefixes(StmtContext<?,?,?> ctx, ImmutableMap.Builder<String,ModuleEffectiveStatement> builder)
UnqualifiedQName
argument()
Returns statement argument.Optional<DataSchemaNode>
findDataChildByName(QName name)
Returns the child node corresponding to the specified name.protected static @NonNull String
findPrefix(@NonNull StmtContext<?,?,?> ctx, String type, String name)
Collection<? extends @NonNull AugmentationSchemaNode>
getAugmentations()
ReturnsAugmentationSchemaNode
instances which contain data fromaugment
statements defined in the module.Collection<? extends DataSchemaNode>
getChildNodes()
Returns set of all child nodes defined within this DataNodeContainer.Optional<String>
getContact()
Returns the module contact.Collection<? extends @NonNull Deviation>
getDeviations()
ReturnsDeviation
instances which contain data fromdeviation
statements defined in the module.Collection<? extends @NonNull ExtensionDefinition>
getExtensionSchemaNodes()
ReturnsExtensionDefinition
instances which contain data fromextension
statements defined in the module.Collection<? extends @NonNull FeatureDefinition>
getFeatures()
ReturnsFeatureDefinition
instances which contain data fromfeature
statements defined in the module.Collection<? extends GroupingDefinition>
getGroupings()
Returns set of all groupings defined within this DataNodeContainer.Collection<? extends @NonNull IdentitySchemaNode>
getIdentities()
ReturnsIdentitySchemaNode
instances which contain data fromidentity
statements defined in the module.Collection<? extends @NonNull ModuleImport>
getImports()
Returns imports which represents YANG modules which are imported to this module viaimport
statement.String
getName()
Returns the name of the module which is specified as argument of YANGmodule
statement.Collection<? extends @NonNull NotificationDefinition>
getNotifications()
Return the set of notifications in this container, keyed by QName.Optional<String>
getOrganization()
Returns the module organization.String
getPrefix()
Returns the prefix of the module.Collection<? extends @NonNull RpcDefinition>
getRpcs()
ReturnsRpcDefinition
instances which contain data fromrpc
statements defined in the module.Optional<SemVer>
getSemanticVersion()
Returns the semantic version of YANG module.Collection<? extends TypeDefinition<?>>
getTypeDefinitions()
Returns set of all newly defined types within this DataNodeContainer.Collection<? extends UsesNode>
getUses()
Returns grouping nodes used ny this container.YangVersion
getYangVersion()
Returns the YANG version.protected static @NonNull Object
maskList(ImmutableList<?> list)
Utility method for squashing singleton lists into single objects.protected static @NonNull Object
maskSet(ImmutableSet<?> set)
String
toString()
protected static <T> @NonNull ImmutableList<T>
unmaskList(@NonNull Object masked, @NonNull Class<T> type)
Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.protected static <T> @NonNull ImmutableSet<? extends T>
unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.DefaultWithDataTree.WithSubstatements
effectiveSubstatements
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.DefaultWithDataTree
dataTreeNamespace, getDeclared, schemaTreeNamespace
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.WithDataTree
getNamespaceContents
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.WithSchemaTree
findDataSchemaNode
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement
getStatementSource
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveStatement
get, getAll, unmaskList
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DataNodeContainer
dataChildByName, findDataChildByName, findDataTreeChild, findDataTreeChild, findDataTreeChild, getDataChildByName
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement
effectiveSubstatements, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, get, getAll, getDeclared, streamEffectiveSubstatements
-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMixins.DocumentedNodeMixin
getDescription, getReference, getUnknownSchemaNodes
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
getStatementSource, statementDefinition
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.ModuleLike
getSubmodules
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.stmt.compat.NotificationNodeContainerCompat
findNotification
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.QNameModuleAware
getNamespace, getQNameModule, getRevision
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement
findSchemaTreeNode
-
-
-
-
Constructor Detail
-
AbstractEffectiveModule
protected AbstractEffectiveModule(D declared, StmtContext<UnqualifiedQName,D,? extends EffectiveStatement<UnqualifiedQName,?>> ctx, ImmutableList<? extends EffectiveStatement<?,?>> substatements, String prefix)
-
-
Method Detail
-
argument
public UnqualifiedQName argument()
Description copied from interface:ModelStatement
Returns statement argument.- Specified by:
argument
in interfaceModelStatement<D extends DeclaredStatement<UnqualifiedQName>>
- Returns:
- statement argument or null if statement does not have argument.
-
getName
public String getName()
Description copied from interface:ModuleLike
Returns the name of the module which is specified as argument of YANGmodule
statement.- Specified by:
getName
in interfaceModuleLike
- Returns:
- string with the name of the module
-
getPrefix
public String getPrefix()
Description copied from interface:ModuleLike
Returns the prefix of the module.- Specified by:
getPrefix
in interfaceModuleLike
- Returns:
- string with the module prefix which is specified as argument of YANG
prefix
statement
-
getYangVersion
public YangVersion getYangVersion()
Description copied from interface:ModuleLike
Returns the YANG version.- Specified by:
getYangVersion
in interfaceModuleLike
- Returns:
- YANG version of this module.
-
getOrganization
public Optional<String> getOrganization()
Description copied from interface:ModuleLike
Returns the module organization.- Specified by:
getOrganization
in interfaceModuleLike
- Returns:
- string with the name of the organization specified in the module as the argument of YANG
organization
statement
-
getContact
public Optional<String> getContact()
Description copied from interface:ModuleLike
Returns the module contact.The contact represents the person or persons to whom technical queries concerning this module should be sent, such as their name, postal address, telephone number, and electronic mail address.
- Specified by:
getContact
in interfaceModuleLike
- Returns:
- string with the contact data specified in the module as the argument of YANG
contact
statement
-
getImports
public Collection<? extends @NonNull ModuleImport> getImports()
Description copied from interface:ModuleLike
Returns imports which represents YANG modules which are imported to this module viaimport
statement.- Specified by:
getImports
in interfaceModuleLike
- Returns:
- set of module imports which are specified in the module as the argument of YANG
import
statements.
-
getFeatures
public Collection<? extends @NonNull FeatureDefinition> getFeatures()
Description copied from interface:ModuleLike
ReturnsFeatureDefinition
instances which contain data fromfeature
statements defined in the module.The feature is used to define a mechanism by which portions of the schema are marked as conditional.
- Specified by:
getFeatures
in interfaceModuleLike
- Returns:
- feature statements in lexicographical order which are specified in the module as the argument of YANG
feature
statements.
-
getNotifications
public Collection<? extends @NonNull NotificationDefinition> getNotifications()
Description copied from interface:NotificationNodeContainer
Return the set of notifications in this container, keyed by QName. RFC7950 specifies thatAugmentationSchemaNode
s,GroupingDefinition
s,ListSchemaNode
s andContainerSchemaNode
s can also containNotificationDefinition
s.- Specified by:
getNotifications
in interfaceNotificationNodeContainer
- Returns:
- set of notification nodes
-
getAugmentations
public Collection<? extends @NonNull AugmentationSchemaNode> getAugmentations()
Description copied from interface:ModuleLike
ReturnsAugmentationSchemaNode
instances which contain data fromaugment
statements defined in the module.- Specified by:
getAugmentations
in interfaceModuleLike
- Returns:
- set of the augmentation schema instances which are specified in the module as YANG
augment
statement and are lexicographically ordered
-
getRpcs
public Collection<? extends @NonNull RpcDefinition> getRpcs()
Description copied from interface:ModuleLike
ReturnsRpcDefinition
instances which contain data fromrpc
statements defined in the module.- Specified by:
getRpcs
in interfaceModuleLike
- Returns:
- set of the RPC definition instances which are specified in the module as YANG
rpc
statements and are lexicographicaly ordered
-
getDeviations
public Collection<? extends @NonNull Deviation> getDeviations()
Description copied from interface:ModuleLike
ReturnsDeviation
instances which contain data fromdeviation
statements defined in the module.- Specified by:
getDeviations
in interfaceModuleLike
- Returns:
- set of the deviation instances
-
getExtensionSchemaNodes
public Collection<? extends @NonNull ExtensionDefinition> getExtensionSchemaNodes()
Description copied from interface:ModuleLike
ReturnsExtensionDefinition
instances which contain data fromextension
statements defined in the module.- Specified by:
getExtensionSchemaNodes
in interfaceModuleLike
- Returns:
- set of extension definition instances which are specified in the module as YANG
extension
statements and are lexicographically ordered
-
getIdentities
public Collection<? extends @NonNull IdentitySchemaNode> getIdentities()
Description copied from interface:ModuleLike
ReturnsIdentitySchemaNode
instances which contain data fromidentity
statements defined in the module.- Specified by:
getIdentities
in interfaceModuleLike
- Returns:
- set of identity schema node instances which are specified in the module as YANG
identity
statements and are lexicographically ordered
-
getTypeDefinitions
public final Collection<? extends TypeDefinition<?>> getTypeDefinitions()
Description copied from interface:DataNodeContainer
Returns set of all newly defined types within this DataNodeContainer.- Specified by:
getTypeDefinitions
in interfaceDataNodeContainer
- Returns:
- typedef statements in lexicographical order
-
getChildNodes
public final Collection<? extends DataSchemaNode> getChildNodes()
Description copied from interface:DataNodeContainer
Returns set of all child nodes defined within this DataNodeContainer. Although the return type is a collection, each node is guaranteed to be present at most once.Note that the nodes returned are NOT
data nodes
, but ratherDataSchemaNode
s, henceChoiceSchemaNode
andCaseSchemaNode
are present instead of their children. This is consistent withschema tree
.- Specified by:
getChildNodes
in interfaceDataNodeContainer
- Returns:
- child nodes in lexicographical order
-
getGroupings
public final Collection<? extends GroupingDefinition> getGroupings()
Description copied from interface:DataNodeContainer
Returns set of all groupings defined within this DataNodeContainer.- Specified by:
getGroupings
in interfaceDataNodeContainer
- Returns:
- grouping statements in lexicographical order
-
findDataChildByName
public final Optional<DataSchemaNode> findDataChildByName(QName name)
Description copied from interface:DataNodeContainer
Returns the child node corresponding to the specified name.Note that the nodes searched are NOT
data nodes
, but ratherDataSchemaNode
s, henceChoiceSchemaNode
andCaseSchemaNode
are returned instead of their matching children.- Specified by:
findDataChildByName
in interfaceDataNodeContainer
- Parameters:
name
- QName of child- Returns:
- child node of this DataNodeContainer if child with given name is present, empty otherwise
-
getUses
public Collection<? extends UsesNode> getUses()
Description copied from interface:DataNodeContainer
Returns grouping nodes used ny this container.- Specified by:
getUses
in interfaceDataNodeContainer
- Returns:
- Set of all uses nodes defined within this DataNodeContainer
-
getSemanticVersion
public Optional<SemVer> getSemanticVersion()
Description copied from interface:ModuleLike
Returns the semantic version of YANG module. If the semantic version is not specified, default semantic version of module is returned.- Specified by:
getSemanticVersion
in interfaceModuleLike
- Returns:
- SemVer semantic version of YANG module which is specified as argument of
(urn:opendaylight:yang:extension:semantic-version?revision=2016-02-02)semantic-version
statement
-
findPrefix
protected static final @NonNull String findPrefix(@NonNull StmtContext<?,?,?> ctx, String type, String name)
-
appendPrefixes
protected final void appendPrefixes(StmtContext<?,?,?> ctx, ImmutableMap.Builder<String,ModuleEffectiveStatement> builder)
-
maskList
protected static final @NonNull Object maskList(ImmutableList<?> list)
Utility method for squashing singleton lists into single objects. This is a CPU/mem trade-off, which we are usually willing to make: for the cost of an instanceof check we can save one object and re-create it when needed. The inverse operation is #unmaskSubstatements(Object)}.- Parameters:
list
- list to mask- Returns:
- Masked list
- Throws:
NullPointerException
- if list is null
-
unmaskList
protected static final <T> @NonNull ImmutableList<T> unmaskList(@NonNull Object masked, @NonNull Class<T> type)
Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.- Parameters:
masked
- list to unmask- Returns:
- Unmasked list
- Throws:
NullPointerException
- if any argument is nullClassCastException
- if masked object does not match expected class
-
maskSet
protected static final @NonNull Object maskSet(ImmutableSet<?> set)
-
unmaskSet
protected static final <T> @NonNull ImmutableSet<? extends T> unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-
-