Interface BoundStmtCtx<A>
- Type Parameters:
A- Argument type
- All Superinterfaces:
CommonStmtCtx
- All Known Subinterfaces:
BoundStmtCtxCompat<A,,D> EffectiveStmtCtx.Current<A,,D> EffectiveStmtCtx.UndeclaredCurrent<A,,D> RootStmtContext<A,,D, E> RootStmtContext.Mutable<A,,D, E> StmtContext<A,,D, E> StmtContext.Mutable<A,D, E>
A
CommonStmtCtx which has additionally been bound to a StatementSupport. It provides
argument() as interpreted by that support.-
Method Summary
Modifier and TypeMethodDescription@Nullable Aargument()Return the statement argument.<X,Z extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<X, ?>>
@NonNull Optional<X>findSubstatementArgument(@NonNull Class<Z> type) Search of any child statement context of specified type and return its argument.default @NonNull AReturn the statement argument in literal format.booleanhasSubstatement(@NonNull Class<? extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?, ?>> type) Check if there is any child statement context of specified type.@NonNull YangVersionReturn theYangVersionassociated with this statement.Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.CommonStmtCtx
getRawArgument, producesDeclared, producesEffective, publicDefinition, rawArgument, sourceReference
-
Method Details
-
argument
@Nullable A argument()Return the statement argument.- Returns:
- statement argument, or null if this statement does not have an argument
-
getArgument
Return the statement argument in literal format.- Returns:
- raw statement argument string
- Throws:
com.google.common.base.VerifyException- if this statement does not have an argument
-
yangVersion
@NonNull YangVersion yangVersion()Return theYangVersionassociated with this statement.- Returns:
- YANG version used to bind this statement
-
findSubstatementArgument
<X,Z extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<X, @NonNull Optional<X> findSubstatementArgument?>> (@NonNull Class<Z> type) Search of any child statement context of specified type and return its argument. If such a statement exists, it is assumed to have the right argument. Users should be careful to use this method for statements which have cardinality0..1, otherwise this method can return any one of the statement's argument.- Type Parameters:
X- Substatement argument typeZ- Substatement effective statement representation- Parameters:
type- Effective statement representation being look up- Returns:
Optional.empty()if no statement exists, otherwise the argument value
-
hasSubstatement
boolean hasSubstatement(@NonNull Class<? extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<?, ?>> type) Check if there is any child statement context of specified type.- Parameters:
type- Effective statement representation being look up- Returns:
- True if such a child statement exists, false otherwise
-