Class AbstractEffectiveStatement<A,D extends DeclaredStatement<A>>
- java.lang.Object
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveStatement<A,D>
-
- Type Parameters:
A
- Argument type (Void
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
,EffectiveStatementBase
@Beta public abstract class AbstractEffectiveStatement<A,D extends DeclaredStatement<A>> extends Object implements EffectiveStatement<A,D>
Baseline stateless implementation of an EffectiveStatement. This class adds a few default implementations and namespace dispatch, but does not actually force any state on its subclasses. This approach is different fromEffectiveStatementBase
in that it adds requirements for an implementation, but it leaves it up to the final class to provide object layout.This finds immense value in catering the common case, for example effective statements which can, but typically do not, contain substatements.
-
-
Constructor Summary
Constructors Constructor Description AbstractEffectiveStatement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V,N extends IdentifierNamespace<K,V>>
Optional<? extends 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(@NonNull Class<N> namespace)
Return the statement-specific contents of specified namespace, if available.-
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
effectiveSubstatements, findAll, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, getDeclared, streamEffectiveSubstatements
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
argument, getStatementSource, statementDefinition
-
-
-
-
Method Detail
-
get
public final <K,V,N extends IdentifierNamespace<K,V>> Optional<? extends 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.
-
getNamespaceContents
protected <K,V,N extends IdentifierNamespace<K,V>> Optional<? extends Map<K,V>> getNamespaceContents(@NonNull Class<N> namespace)
Return the statement-specific contents of specified namespace, if available.- Parameters:
namespace
- Requested namespace- Returns:
- Namespace contents, if available.
-
-