Interface StatementFactory<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
- Type Parameters:
A- Argument typeD- Declared Statement representationE- Effective Statement representation
- All Known Implementing Classes:
AbstractBooleanStatementSupport,AbstractEmptyStatementSupport,AbstractInternedStatementSupport,AbstractInternedStringStatementSupport,AbstractQNameStatementSupport,AbstractSchemaTreeStatementSupport,AbstractStatementSupport,AbstractStringStatementSupport,AbstractUnqualifiedStatementSupport,ForwardingStatementSupport,StatementSupport
public interface StatementFactory<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
An entity capable of creating
DeclaredStatement and EffectiveStatement instances for a particular
type. This interface is usually realized as an implementation-specific combination with StatementSupport.-
Method Summary
Modifier and TypeMethodDescriptionbooleancanReuseCurrent(@NonNull EffectiveStmtCtx.Current<A, D> copy, @NonNull EffectiveStmtCtx.Current<A, D> current, @NonNull Collection<? extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?, ?>> substatements) Determine reactor copy behaviour of a statement instance.@NonNull EcopyEffective(@NonNull EffectiveStmtCtx.Current<A, D> stmt, @NonNull E original) Create aEffectiveStatementcopy of provided original for specified context.@NonNull DcreateDeclared(@NonNull BoundStmtCtx<A> ctx, @NonNull Stream<org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>> substatements) Create aDeclaredStatementfor specified context.@NonNull EcreateEffective(@NonNull EffectiveStmtCtx.Current<A, D> stmt, Stream<? extends StmtContext<?, ?, ?>> declaredSubstatements, Stream<? extends StmtContext<?, ?, ?>> inferredSubstatements) Create aEffectiveStatementfor specified context.@Nullable EffectiveStatementStateextractEffectiveState(@NonNull E stmt) Return theEffectiveStatementStatefor a particular statement.
-
Method Details
-
createDeclared
@NonNull D createDeclared(@NonNull BoundStmtCtx<A> ctx, @NonNull Stream<org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>> substatements) Create aDeclaredStatementfor specified context.- Parameters:
ctx- Statement contextsubstatements- Declared substatements- Returns:
- A declared statement instance.
-
createEffective
@NonNull E createEffective(@NonNull EffectiveStmtCtx.Current<A, D> stmt, Stream<? extends StmtContext<?, ?, ?>> declaredSubstatements, Stream<? extends StmtContext<?, ?, ?>> inferredSubstatements) Create aEffectiveStatementfor specified context.- Parameters:
stmt- Effective capture of this statement's significant statedeclaredSubstatements- effectively-visible declared substatementsinferredSubstatements- effectively-visible inferred substatements- Returns:
- An effective statement instance
-
copyEffective
Create aEffectiveStatementcopy of provided original for specified context.- Parameters:
stmt- Effective capture of this statement's significant stateoriginal- Original effective statement- Returns:
- An effective statement instance
- Throws:
NullPointerException- if any argument is null
-
canReuseCurrent
boolean canReuseCurrent(@NonNull EffectiveStmtCtx.Current<A, D> copy, @NonNull EffectiveStmtCtx.Current<A, D> current, @NonNull Collection<? extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?, ?>> substatements) Determine reactor copy behaviour of a statement instance. Implementations classes are required to determine their operations with regard to their statements being replicated into different contexts -- potentially sharing instantiations.Implementations are examine
copyas to whether it would result in the same semantics ascurrentdoes, provided thatcurrent'ssubstatementsare properly propagated.- Parameters:
copy- Copy of current effective contextcurrent- Current effective contextsubstatements- Current effective substatements- Returns:
- True if the differences between
copyandcurrentdo not affect this statement's effective semantics. - Throws:
NullPointerException- if any argument is null
-
extractEffectiveState
Return theEffectiveStatementStatefor a particular statement. This acts as a summary for comparison with statements created by this factory, without taking substatements into account. This is an optional operation, it is always safe to return null.- Parameters:
stmt- EffectiveStatement to examine- Returns:
- EffectiveStatementState or null if the statement cannot be expressed
-