A
- Argument type (Void
if statement does not have argument.)D
- Class representing declared version of this statement.@Beta public abstract class AbstractEffectiveStatement<A,D extends DeclaredStatement<A>> extends Object implements EffectiveStatement<A,D>
EffectiveStatementBase
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 and Description |
---|
AbstractEffectiveStatement() |
Modifier and Type | Method and Description |
---|---|
Collection<? extends EffectiveStatement<?,?>> |
effectiveSubstatements()
Returns a collection of all effective substatements.
|
<K,V,N extends IdentifierNamespace<K,V>> |
get(Class<N> namespace,
K identifier)
Returns value associated with supplied identifier.
|
<K,V,N extends IdentifierNamespace<K,V>> |
getAll(Class<N> namespace)
Returns all local values from supplied namespace.
|
protected <K,V,N extends IdentifierNamespace<K,V>> |
getNamespaceContents(@NonNull Class<N> namespace)
Return the statement-specific contents of specified namespace, if available.
|
protected static @NonNull Object |
maskList(ImmutableList<?> list)
Utility method for squashing singleton lists into single objects.
|
protected static @NonNull ImmutableList<? extends EffectiveStatement<?,?>> |
unmaskList(@NonNull Object masked)
Utility method for recovering singleton lists squashed by
maskList(ImmutableList) . |
protected static <T> @NonNull ImmutableList<T> |
unmaskList(@NonNull Object masked,
@NonNull Class<T> type)
Utility method for recovering singleton lists squashed by
maskList(ImmutableList) . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAll, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, getDeclared, streamEffectiveSubstatements
argument, getStatementSource, statementDefinition
public final <K,V,N extends IdentifierNamespace<K,V>> V get(Class<N> namespace, K identifier)
EffectiveStatement
get
in interface EffectiveStatement<A,D extends DeclaredStatement<A>>
K
- Identifier typeV
- Value typeN
- Namespace identifier typenamespace
- Namespace typeidentifier
- Identifier of element.public final <K,V,N extends IdentifierNamespace<K,V>> Map<K,V> getAll(Class<N> namespace)
EffectiveStatement
getAll
in interface EffectiveStatement<A,D extends DeclaredStatement<A>>
K
- Identifier typeV
- Value typeN
- Namespace identifier typenamespace
- Namespace typepublic Collection<? extends EffectiveStatement<?,?>> effectiveSubstatements()
EffectiveStatement
effectiveSubstatements
in interface EffectiveStatement<A,D extends DeclaredStatement<A>>
protected <K,V,N extends IdentifierNamespace<K,V>> Optional<? extends Map<K,V>> getNamespaceContents(@NonNull Class<N> namespace)
namespace
- Requested namespaceprotected static final @NonNull ImmutableList<? extends EffectiveStatement<?,?>> unmaskList(@NonNull Object masked)
maskList(ImmutableList)
.masked
- list to unmaskNullPointerException
- if masked is nullClassCastException
- if masked object does not match EffectiveStatementprotected static final @NonNull Object maskList(ImmutableList<?> list)
list
- list to maskNullPointerException
- if list is nullprotected static final <T> @NonNull ImmutableList<T> unmaskList(@NonNull Object masked, @NonNull Class<T> type)
maskList(ImmutableList)
.masked
- list to unmaskNullPointerException
- if any argument is nullClassCastException
- if masked object does not match expected classCopyright © 2020 OpenDaylight. All rights reserved.