Class AbstractConstraintEffectiveStatement<A,D extends DeclaredStatement<A>>
- java.lang.Object
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveStatement<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementBase<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.DeclaredEffectiveStatementBase<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveDocumentedNode<A,D>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractConstraintEffectiveStatement<A,D>
-
- All Implemented Interfaces:
ConstraintMetaDefinition
,DocumentedNode
,EffectiveStatement<A,D>
,ModelStatement<A>
- Direct Known Subclasses:
AbstractListConstraintEffectiveStatement
@Beta public abstract class AbstractConstraintEffectiveStatement<A,D extends DeclaredStatement<A>> extends AbstractEffectiveDocumentedNode<A,D> implements ConstraintMetaDefinition
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.yang.model.api.DocumentedNode
DocumentedNode.WithStatus
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractConstraintEffectiveStatement(StmtContext<A,D,?> ctx)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description A
argument()
Returns statement argument.protected abstract A
createConstraints(A argument)
Optional<String>
getErrorAppTag()
Returns the value of the argument of YANGerror-app-tag
keyword.Optional<String>
getErrorMessage()
Returns the value of the argument of YANGerror-message
keyword.ModifierKind
getModifier()
boolean
isCustomizedStatement()
protected static @NonNull Object
maskList(ImmutableList<?> list)
Utility method for squashing singleton lists into single objects.protected static @NonNull Object
maskSet(ImmutableSet<?> set)
protected static <T> @NonNull ImmutableList<T>
unmaskList(@NonNull Object masked, @NonNull Class<T> type)
Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.protected static <T> @NonNull ImmutableSet<? extends T>
unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveDocumentedNode
getDescription, getReference, nullableDescription, nullableReference
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.DeclaredEffectiveStatementBase
getDeclared, getStatementSource, statementDefinition
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementBase
allSubstatementsOfType, effectiveSubstatements, firstEffectiveSubstatementOfType, firstSchemaNode, firstSubstatementOfType, firstSubstatementOfType, initSubstatements
-
Methods inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveStatement
get, getAll, getNamespaceContents, unmaskList
-
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.DocumentedNode
getDescription, getReference, getUnknownSchemaNodes
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement
findAll, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, streamEffectiveSubstatements
-
-
-
-
Constructor Detail
-
AbstractConstraintEffectiveStatement
protected AbstractConstraintEffectiveStatement(StmtContext<A,D,?> ctx)
-
-
Method Detail
-
argument
public final A argument()
Description copied from interface:ModelStatement
Returns statement argument.- Specified by:
argument
in interfaceModelStatement<A>
- Overrides:
argument
in classDeclaredEffectiveStatementBase<A,D extends DeclaredStatement<A>>
- Returns:
- statement argument or null if statement does not have argument.
-
isCustomizedStatement
public final boolean isCustomizedStatement()
-
getModifier
public final ModifierKind getModifier()
-
getErrorAppTag
public final Optional<String> getErrorAppTag()
Description copied from interface:ConstraintMetaDefinition
Returns the value of the argument of YANGerror-app-tag
keyword.- Specified by:
getErrorAppTag
in interfaceConstraintMetaDefinition
- Returns:
- string with the application tag, or empty if it was not provided.
-
getErrorMessage
public final Optional<String> getErrorMessage()
Description copied from interface:ConstraintMetaDefinition
Returns the value of the argument of YANGerror-message
keyword.- Specified by:
getErrorMessage
in interfaceConstraintMetaDefinition
- Returns:
- string with the error message, or empty if it was not provided.
-
maskList
protected static final @NonNull Object maskList(ImmutableList<?> list)
Utility method for squashing singleton lists into single objects. This is a CPU/mem trade-off, which we are usually willing to make: for the cost of an instanceof check we can save one object and re-create it when needed. The inverse operation is #unmaskSubstatements(Object)}.- Parameters:
list
- list to mask- Returns:
- Masked list
- Throws:
NullPointerException
- if list is null
-
unmaskList
protected static final <T> @NonNull ImmutableList<T> unmaskList(@NonNull Object masked, @NonNull Class<T> type)
Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.- Parameters:
masked
- list to unmask- Returns:
- Unmasked list
- Throws:
NullPointerException
- if any argument is nullClassCastException
- if masked object does not match expected class
-
maskSet
protected static final @NonNull Object maskSet(ImmutableSet<?> set)
-
unmaskSet
protected static final <T> @NonNull ImmutableSet<? extends T> unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-
-