Class AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,D extends DeclaredStatement<A>>
java.lang.Object
org.opendaylight.yangtools.yang.model.api.meta.AbstractEffectiveStatement<A,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractUndeclaredEffectiveStatement<A,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractUndeclaredEffectiveStatement.WithSchemaTree<A,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractUndeclaredEffectiveStatement.WithDataTree<A,D>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,D>
- Type Parameters:
A
- Argument type (Empty
if statement does not have argument.)D
- Class representing declared version of this statement.
- All Implemented Interfaces:
EffectiveStatement<A,
,D> ModelStatement<A>
,DataTreeAwareEffectiveStatement<A,
,D> SchemaTreeAwareEffectiveStatement<A,
D>
- Direct Known Subclasses:
UndeclaredCaseEffectiveStatement
,UndeclaredInputEffectiveStatement
,UndeclaredOutputEffectiveStatement
- Enclosing class:
AbstractUndeclaredEffectiveStatement<A,
D extends DeclaredStatement<A>>
public abstract static class AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,D extends DeclaredStatement<A>>
extends AbstractUndeclaredEffectiveStatement.WithDataTree<A,D>
Stateful version of
AbstractUndeclaredEffectiveStatement.WithDataTree
. Schema tree and data tree namespaces are eagerly instantiated
(and checked).-
Nested Class Summary
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractUndeclaredEffectiveStatement
AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,
D extends DeclaredStatement<A>>, AbstractUndeclaredEffectiveStatement.DefaultWithSchemaTree<A, D extends DeclaredStatement<A>>, AbstractUndeclaredEffectiveStatement.WithDataTree<A, D extends DeclaredStatement<A>>, AbstractUndeclaredEffectiveStatement.WithSchemaTree<A, D extends DeclaredStatement<A>> -
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultWithDataTree
(ImmutableList<? extends EffectiveStatement<?, ?>> substatements) protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected MoreObjects.ToStringHelper
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 Collection
<DataTreeEffectiveStatement<?>> Return the mapping ofdata tree
children of this statement.final ImmutableList
<? extends EffectiveStatement<?, ?>> Returns a collection of all effective substatements.final boolean
final Optional
<DataTreeEffectiveStatement<?>> findDataTreeNode
(QName qname) Find adata tree
childDataTreeEffectiveStatement
, as identified by its QName argument.final Optional
<SchemaTreeEffectiveStatement<?>> findSchemaTreeNode
(QName qname) Find aschema tree
childSchemaTreeEffectiveStatement
, as identified by its QName argument.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 Collection
<SchemaTreeEffectiveStatement<?>> Enumerate allschema node
s defined within this node.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.AbstractUndeclaredEffectiveStatement.WithSchemaTree
dataSchemaNode
Methods inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractUndeclaredEffectiveStatement
getDeclared
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.stmt.DataTreeAwareEffectiveStatement
findDataTreeNode
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement
collectEffectiveSubstatements, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, getDeclared, statementOrigin, streamEffectiveSubstatements
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
argument, statementDefinition
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement
findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode, findSchemaTreeNode
-
Constructor Details
-
DefaultWithDataTree
-
DefaultWithDataTree
protected DefaultWithDataTree(AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A, D> original)
-
-
Method Details
-
effectiveSubstatements
Description copied from interface:EffectiveStatement
Returns a collection of all effective substatements.- Specified by:
effectiveSubstatements
in interfaceEffectiveStatement<A,
D extends DeclaredStatement<A>> - Returns:
- collection of all effective substatements.
-
schemaTreeNodes
Description copied from interface:SchemaTreeAwareEffectiveStatement
Enumerate allschema node
s defined within this node.- Returns:
- All substatements participating on the
schema tree
-
findSchemaTreeNode
Description copied from interface:SchemaTreeAwareEffectiveStatement
Find aschema tree
childSchemaTreeEffectiveStatement
, as identified by its QName argument.- Parameters:
qname
- Child identifier- Returns:
- Schema tree child, or empty
-
dataTreeNodes
Description copied from interface:DataTreeAwareEffectiveStatement
Return the mapping ofdata tree
children of this statement. This is a subtree ofSchemaTreeAwareEffectiveStatement.schemaTreeNodes()
in that all data nodes are also schema nodes. The structure of the tree is different, though, aschoice
andcase
statements are glossed over and they do not contribute to the tree hierarchy -- only their children do.Note that returned statements are not necessarily direct substatements of this statement.
- Returns:
- All substatements participating on the
data tree
-
findDataTreeNode
Description copied from interface:DataTreeAwareEffectiveStatement
Find adata tree
childDataTreeEffectiveStatement
, as identified by its QName argument.- Parameters:
qname
- Child identifier- Returns:
- Data tree child, or empty
-
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)
-