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>
- All Known Implementing Classes:
RootStatementContext
@Beta public interface BoundStmtCtx<A> extends CommonStmtCtx
ACommonStmtCtx
which has additionally been bound to aStatementSupport
. It providesargument()
as interpreted by that support.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @Nullable A
argument()
Return the statement argument.<X,Z extends 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 A
getArgument()
Return the statement argument in literal format.boolean
hasSubstatement(@NonNull Class<? extends EffectiveStatement<?,?>> type)
Check if there is any child statement context of specified type.@NonNull YangVersion
yangVersion()
Return theYangVersion
associated with this statement.-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.CommonStmtCtx
getRawArgument, producesDeclared, producesEffective, publicDefinition, rawArgument, sourceReference
-
-
-
-
Method Detail
-
argument
@Nullable A argument()
Return the statement argument.- Returns:
- statement argument, or null if this statement does not have an argument
-
getArgument
default @NonNull A getArgument()
Return the statement argument in literal format.- Returns:
- raw statement argument string
- Throws:
VerifyException
- if this statement does not have an argument
-
yangVersion
@NonNull YangVersion yangVersion()
Return theYangVersion
associated with this statement.- Returns:
- YANG version used to bind this statement
-
findSubstatementArgument
<X,Z extends 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 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
-
-