Class AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>
- java.lang.Object
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveStatement<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractUndeclaredEffectiveStatement<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractUndeclaredEffectiveStatement.WithSchemaTree<A,D,E>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractUndeclaredEffectiveStatement.WithDataTree<A,D,E>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,D,E>
-
- Type Parameters:
A
- Argument type (Void
if statement does not have argument.)D
- Class representing declared version of this statement.E
- Class representing effective version of this statement.
- All Implemented Interfaces:
EffectiveStatement<A,D>
,ModelStatement<A>
- Direct Known Subclasses:
AbstractUndeclaredEffectiveStatement.DefaultWithDataTree.WithSubstatements
- Enclosing class:
- AbstractUndeclaredEffectiveStatement<A,D extends DeclaredStatement<A>>
public abstract static class AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>> extends AbstractUndeclaredEffectiveStatement.WithDataTree<A,D,E>
Stateful version ofAbstractUndeclaredEffectiveStatement.WithDataTree
. Schema tree and data tree namespaces are eagerly instantiated (and checked).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractUndeclaredEffectiveStatement.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.AbstractUndeclaredEffectiveStatement
AbstractUndeclaredEffectiveStatement.DefaultWithDataTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>, AbstractUndeclaredEffectiveStatement.DefaultWithSchemaTree<A,D extends DeclaredStatement<A>,E extends SchemaTreeAwareEffectiveStatement<A,D>>, AbstractUndeclaredEffectiveStatement.WithDataTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>, AbstractUndeclaredEffectiveStatement.WithSchemaTree<A,D extends DeclaredStatement<A>,E extends SchemaTreeAwareEffectiveStatement<A,D>>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultWithDataTree(StmtContext<?,?,?> ctx, ImmutableList<? extends EffectiveStatement<?,?>> substatements)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<QName,DataTreeEffectiveStatement<?>>
dataTreeNamespace()
protected static @NonNull Object
maskList(ImmutableList<?> list)
Utility method for squashing singleton lists into single objects.protected static @NonNull Object
maskSet(ImmutableSet<?> set)
protected Map<QName,SchemaTreeEffectiveStatement<?>>
schemaTreeNamespace()
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.AbstractUndeclaredEffectiveStatement.WithDataTree
getNamespaceContents
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractUndeclaredEffectiveStatement.WithSchemaTree
findDataSchemaNode
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractUndeclaredEffectiveStatement
getDeclared, getStatementSource
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveStatement
effectiveSubstatements, get, getAll, unmaskList
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement
findAll, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, streamEffectiveSubstatements
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
argument, statementDefinition
-
-
-
-
Constructor Detail
-
DefaultWithDataTree
protected DefaultWithDataTree(StmtContext<?,?,?> ctx, ImmutableList<? extends EffectiveStatement<?,?>> substatements)
-
-
Method Detail
-
schemaTreeNamespace
protected final Map<QName,SchemaTreeEffectiveStatement<?>> schemaTreeNamespace()
- Specified by:
schemaTreeNamespace
in classAbstractUndeclaredEffectiveStatement.WithSchemaTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>
-
dataTreeNamespace
protected final Map<QName,DataTreeEffectiveStatement<?>> dataTreeNamespace()
- Specified by:
dataTreeNamespace
in classAbstractUndeclaredEffectiveStatement.WithDataTree<A,D extends DeclaredStatement<A>,E extends DataTreeAwareEffectiveStatement<A,D>>
-
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)
-
-