Class AbstractDeclaredEffectiveStatement.WithDataTree<A,D extends DeclaredStatement<A>>
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement<A,D>
-
- org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.WithSchemaTree<A,D>
-
- org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.WithDataTree<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>
- Direct Known Subclasses:
AbstractDeclaredEffectiveStatement.DefaultWithDataTree
- Enclosing class:
- AbstractDeclaredEffectiveStatement<A,D extends DeclaredStatement<A>>
public abstract static class AbstractDeclaredEffectiveStatement.WithDataTree<A,D extends DeclaredStatement<A>> extends AbstractDeclaredEffectiveStatement.WithSchemaTree<A,D>
Base stateless superclass forDataTreeAwareEffectiveStatement
s. It maintains the contents of data tree namespace based of effective substatements.
-
-
Nested Class Summary
-
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>>
-
-
Constructor Summary
Constructors Constructor Description WithDataTree()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected MoreObjects.ToStringHelper
addToStringAttributes(MoreObjects.ToStringHelper helper)
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)
protected abstract Map<QName,DataTreeEffectiveStatement<?>>
dataTreeNamespace()
ImmutableList<? extends EffectiveStatement<?,?>>
effectiveSubstatements()
Returns a collection of all effective substatements.boolean
equals(Object obj)
<K,V,N extends IdentifierNamespace<K,V>>
Optional<V>get(Class<N> namespace, K identifier)
Returns value associated with supplied identifier.<K,V,N extends IdentifierNamespace<K,V>>
Map<K,V>getAll(Class<N> namespace)
Returns all local values from supplied namespace.protected <K,V,N extends IdentifierNamespace<K,V>>
Optional<? extends Map<K,V>>getNamespaceContents(Class<N> namespace)
Return the statement-specific contents of specified namespace, if available.int
hashCode()
protected static <T extends SchemaTreeEffectiveStatement<?>>
@NonNull Map<QName,T>immutableNamespaceOf(Map<QName,T> map)
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 @NonNull ImmutableList<? extends @NonNull EffectiveStatement<?,?>>
unmaskList(@NonNull Object masked)
Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.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<T>
unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-
Methods inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.WithSchemaTree
dataSchemaNode, schemaTreeNamespace
-
Methods inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement
getDeclared
-
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.meta.EffectiveStatement
findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, statementOrigin, streamEffectiveSubstatements
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
argument, statementDefinition
-
-
-
-
Method Detail
-
getNamespaceContents
protected <K,V,N extends IdentifierNamespace<K,V>> Optional<? extends Map<K,V>> getNamespaceContents(Class<N> namespace)
Return the statement-specific contents of specified namespace, if available.- Overrides:
getNamespaceContents
in classAbstractDeclaredEffectiveStatement.WithSchemaTree<A,D extends DeclaredStatement<A>>
- Parameters:
namespace
- Requested namespace- Returns:
- Namespace contents, if available.
-
dataTreeNamespace
protected abstract Map<QName,DataTreeEffectiveStatement<?>> dataTreeNamespace()
-
get
public final <K,V,N extends IdentifierNamespace<K,V>> Optional<V> get(Class<N> namespace, K identifier)
Description copied from interface:EffectiveStatement
Returns value associated with supplied identifier.- Specified by:
get
in interfaceEffectiveStatement<A,D extends DeclaredStatement<A>>
- Type Parameters:
K
- Identifier typeV
- Value typeN
- Namespace identifier type- Parameters:
namespace
- Namespace typeidentifier
- Identifier of element.- Returns:
- Value if present
-
getAll
public final <K,V,N extends IdentifierNamespace<K,V>> Map<K,V> getAll(Class<N> namespace)
Description copied from interface:EffectiveStatement
Returns all local values from supplied namespace.- Specified by:
getAll
in interfaceEffectiveStatement<A,D extends DeclaredStatement<A>>
- Type Parameters:
K
- Identifier typeV
- Value typeN
- Namespace identifier type- Parameters:
namespace
- Namespace type- Returns:
- Key-value mappings, empty if the namespace does not exist.
-
effectiveSubstatements
public ImmutableList<? extends EffectiveStatement<?,?>> 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.
-
unmaskList
protected static final @NonNull ImmutableList<? extends @NonNull EffectiveStatement<?,?>> unmaskList(@NonNull Object masked)
Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.- Parameters:
masked
- list to unmask- Returns:
- Unmasked list
- Throws:
NullPointerException
- if masked is nullClassCastException
- if masked object does not match EffectiveStatement
-
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)
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper helper)
-
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<T> unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-
-