Class AbstractEffectiveModule<D extends DeclaredStatement<UnresolvedQName.Unqualified>,E extends DataTreeAwareEffectiveStatement<UnresolvedQName.Unqualified,D>>
java.lang.Object
org.opendaylight.yangtools.yang.model.api.meta.AbstractEffectiveStatement<UnresolvedQName.Unqualified,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement<UnresolvedQName.Unqualified,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.WithSchemaTree<UnresolvedQName.Unqualified,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.WithDataTree<UnresolvedQName.Unqualified,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.DefaultWithDataTree<UnresolvedQName.Unqualified,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.DefaultWithDataTree.WithTypedefNamespace<UnresolvedQName.Unqualified,D>
org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveModule<D,E>
- All Implemented Interfaces:
Immutable
,DataNodeContainer
,DocumentedNode
,EffectiveStatement<UnresolvedQName.Unqualified,
,D> ModelStatement<UnresolvedQName.Unqualified>
,ModuleLike
,NotificationNodeContainer
,QNameModuleAware
,NotificationNodeContainerCompat<UnresolvedQName.Unqualified,
,D, E> DataTreeAwareEffectiveStatement<UnresolvedQName.Unqualified,
,D> SchemaTreeAwareEffectiveStatement<UnresolvedQName.Unqualified,
,D> TypedefAwareEffectiveStatement<UnresolvedQName.Unqualified,
,D> EffectiveStatementMixins.DocumentedNodeMixin<UnresolvedQName.Unqualified,
D>
@Beta
public abstract class AbstractEffectiveModule<D extends DeclaredStatement<UnresolvedQName.Unqualified>,E extends DataTreeAwareEffectiveStatement<UnresolvedQName.Unqualified,D>>
extends AbstractDeclaredEffectiveStatement.DefaultWithDataTree.WithTypedefNamespace<UnresolvedQName.Unqualified,D>
implements ModuleLike, EffectiveStatementMixins.DocumentedNodeMixin<UnresolvedQName.Unqualified,D>, NotificationNodeContainerCompat<UnresolvedQName.Unqualified,D,E>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.DefaultWithDataTree
AbstractDeclaredEffectiveStatement.DefaultWithDataTree.WithTypedefNamespace<A,
D extends DeclaredStatement<A>> Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement
AbstractDeclaredEffectiveStatement.Default<A,
D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultArgument<A, D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultWithArgument<A, D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultWithDataTree<A, D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.DefaultWithSchemaTree<A, D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.WithDataTree<A, D extends DeclaredStatement<A>>, AbstractDeclaredEffectiveStatement.WithSchemaTree<A, D extends DeclaredStatement<A>> 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.model.spi.meta.EffectiveStatementMixins.DocumentedNodeMixin
EffectiveStatementMixins.DocumentedNodeMixin.WithStatus<A,
D extends DeclaredStatement<A>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractEffectiveModule
(EffectiveStmtCtx.Current<UnresolvedQName.Unqualified, D> stmt, ImmutableList<? extends EffectiveStatement<?, ?>> substatements, String prefix) -
Method Summary
Modifier and TypeMethodDescriptionprotected MoreObjects.ToStringHelper
protected final void
appendPrefixes
(EffectiveStmtCtx.Current<?, ?> stmt, ImmutableMap.Builder<String, ModuleEffectiveStatement> builder) argument()
Returns statement argument.protected static @NonNull Map
<QName, DataTreeEffectiveStatement<?>> createDataTreeNamespace
(Collection<SchemaTreeEffectiveStatement<?>> schemaTreeStatements, Map<QName, SchemaTreeEffectiveStatement<?>> schemaTreeNamespace) protected static @NonNull Map
<QName, SchemaTreeEffectiveStatement<?>> createSchemaTreeNamespace
(Collection<? extends EffectiveStatement<?, ?>> substatements) Create a Map containing the contents of the schema tree.protected static @NonNull HashMap
<QName, TypedefEffectiveStatement> createTypedefNamespace
(Collection<? extends EffectiveStatement<?, ?>> substatements) final DataSchemaNode
dataChildByName
(QName name) Returns the child node corresponding to the specified name.final boolean
default <T> @NonNull Collection
<? extends @NonNull T> filterEffectiveStatements
(Class<T> type) protected static final @NonNull String
findPrefix
(CommonStmtCtx stmt, Collection<? extends EffectiveStatement<?, ?>> substatements, String type, String name) Collection
<? extends @NonNull AugmentationSchemaNode> ReturnsAugmentationSchemaNode
instances which contain data fromaugment
statements defined in the module.final Collection
<? extends DataSchemaNode> Returns set of all child nodes defined within this DataNodeContainer.Returns the module contact.Collection
<? extends @NonNull Deviation> ReturnsDeviation
instances which contain data fromdeviation
statements defined in the module.Collection
<? extends @NonNull ExtensionDefinition> ReturnsExtensionDefinition
instances which contain data fromextension
statements defined in the module.Collection
<? extends @NonNull FeatureDefinition> ReturnsFeatureDefinition
instances which contain data fromfeature
statements defined in the module.final Collection
<? extends GroupingDefinition> Returns set of all groupings defined within this DataNodeContainer.Collection
<? extends @NonNull IdentitySchemaNode> ReturnsIdentitySchemaNode
instances which contain data fromidentity
statements defined in the module.Collection
<? extends @NonNull ModuleImport> Returns imports which represents YANG modules which are imported to this module viaimport
statement.getName()
Returns the name of the module which is specified as argument of YANGmodule
statement.Collection
<? extends @NonNull NotificationDefinition> Return the set of notifications in this container, keyed by QName.Returns the module organization.Returns the prefix of the module.Collection
<? extends @NonNull RpcDefinition> getRpcs()
ReturnsRpcDefinition
instances which contain data fromrpc
statements defined in the module.final Collection
<? extends TypeDefinition<?>> Returns set of all newly defined types within this DataNodeContainer.Collection
<? extends UsesNode> getUses()
Returns grouping nodes used ny this container.Returns the YANG version.final int
hashCode()
protected static <T extends SchemaTreeEffectiveStatement<?>>
@NonNull Map<QName, T> immutableNamespaceOf
(Map<QName, T> map) protected static final @NonNull Object
maskList
(ImmutableList<?> list) Utility method for squashing singleton lists into single objects.protected static final @NonNull Object
maskSet
(ImmutableSet<?> set) final String
toString()
protected static final <T> @NonNull ImmutableList
<T> unmaskList
(@NonNull Object masked, @NonNull Class<T> type) Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.protected static final <T> @NonNull ImmutableSet
<T> Methods inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.DefaultWithDataTree
dataTreeNodes, effectiveSubstatements, findDataTreeNode, findSchemaTreeNode, getDeclared, schemaTreeNodes
Methods inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.WithSchemaTree
dataSchemaNode
Methods inherited from class org.opendaylight.yangtools.yang.model.api.meta.AbstractEffectiveStatement
filterOptional, findValue, unmaskList
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DataNodeContainer
findDataChildByName, findDataChildByName, findDataTreeChild, findDataTreeChild, findDataTreeChild, getDataChildByName
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.stmt.DataTreeAwareEffectiveStatement
findDataTreeNode
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement
collectEffectiveSubstatements, effectiveSubstatements, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, getDeclared, statementOrigin, streamEffectiveSubstatements
Methods inherited from interface org.opendaylight.yangtools.yang.model.spi.meta.EffectiveStatementMixins.DocumentedNodeMixin
getDescription, getReference, getUnknownSchemaNodes
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
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, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, schemaTreeNodes
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.stmt.TypedefAwareEffectiveStatement
findTypedef, typedefs
-
Constructor Details
-
AbstractEffectiveModule
protected AbstractEffectiveModule(EffectiveStmtCtx.Current<UnresolvedQName.Unqualified, D> stmt, ImmutableList<? extends EffectiveStatement<?, ?>> substatements, String prefix)
-
-
Method Details
-
argument
Description copied from interface:ModelStatement
Returns statement argument.- Specified by:
argument
in interfaceModelStatement<D extends DeclaredStatement<UnresolvedQName.Unqualified>>
- Returns:
- statement argument.
-
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
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
Description copied from interface:ModuleLike
Returns the YANG version.- Specified by:
getYangVersion
in interfaceModuleLike
- Returns:
- YANG version of this module.
-
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
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
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
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
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
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
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
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
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
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
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
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
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
-
dataChildByName
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. This is consistent withschema tree
.- Specified by:
dataChildByName
in interfaceDataNodeContainer
- Parameters:
name
- QName of child- Returns:
- child node of this DataNodeContainer if child with given name is present, null otherwise
-
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
-
findPrefix
protected static final @NonNull String findPrefix(CommonStmtCtx stmt, Collection<? extends EffectiveStatement<?, ?>> substatements, String type, String name) -
appendPrefixes
protected final void appendPrefixes(EffectiveStmtCtx.Current<?, ?> stmt, ImmutableMap.Builder<String, ModuleEffectiveStatement> builder) -
filterEffectiveStatements
-
createSchemaTreeNamespace
protected static @NonNull Map<QName,SchemaTreeEffectiveStatement<?>> createSchemaTreeNamespace(Collection<? extends EffectiveStatement<?, ?>> substatements) Create a Map containing the contents of the schema tree. Retur- Parameters:
substatements
- Substatements to index- Returns:
- Index of the schema tree as a mutable Map
- Throws:
NullPointerException
- ifsubstatements
is null
-
createDataTreeNamespace
protected static @NonNull Map<QName,DataTreeEffectiveStatement<?>> createDataTreeNamespace(Collection<SchemaTreeEffectiveStatement<?>> schemaTreeStatements, Map<QName, SchemaTreeEffectiveStatement<?>> schemaTreeNamespace) -
immutableNamespaceOf
protected static <T extends SchemaTreeEffectiveStatement<?>> @NonNull Map<QName,T> immutableNamespaceOf(Map<QName, T> map) -
createTypedefNamespace
protected static @NonNull HashMap<QName,TypedefEffectiveStatement> createTypedefNamespace(Collection<? extends EffectiveStatement<?, ?>> substatements) -
hashCode
public final int hashCode() -
equals
-
toString
-
addToStringAttributes
-
maskList
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
-
unmaskSet
protected static final <T> @NonNull ImmutableSet<T> unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-