Class AbstractDeclaredStatement.WithQNameArgument
- java.lang.Object
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredStatement<QName>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredStatement.WithQNameArgument
-
- All Implemented Interfaces:
DeclaredStatement<QName>
,ModelStatement<QName>
- Direct Known Subclasses:
AbstractDeclaredStatement.WithQNameArgument.WithSubstatements
- Enclosing class:
- AbstractDeclaredStatement<A>
public abstract static class AbstractDeclaredStatement.WithQNameArgument extends AbstractDeclaredStatement<QName>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractDeclaredStatement.WithQNameArgument.WithSubstatements
-
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredStatement
AbstractDeclaredStatement.ArgumentToString<A>, AbstractDeclaredStatement.WithArgument<A>, AbstractDeclaredStatement.WithoutArgument, AbstractDeclaredStatement.WithQNameArgument, AbstractDeclaredStatement.WithRawArgument<A>, AbstractDeclaredStatement.WithRawStringArgument
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WithQNameArgument(QName argument)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull QName
argument()
Returns statement argument.protected static @NonNull Object
maskList(ImmutableList<?> list)
Utility method for squashing singleton lists into single objects.protected static @NonNull Object
maskSet(ImmutableSet<?> set)
String
rawArgument()
Returns statement argument as was present in original source.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.AbstractDeclaredStatement
declaredSubstatements, getStatementSource, 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.meta.DeclaredStatement
declaredSubstatements, findFirstDeclaredSubstatement, findFirstDeclaredSubstatementArgument, streamDeclaredSubstatements
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
statementDefinition
-
-
-
-
Constructor Detail
-
WithQNameArgument
protected WithQNameArgument(QName argument)
-
-
Method Detail
-
argument
public final @NonNull QName argument()
Description copied from interface:ModelStatement
Returns statement argument.- Returns:
- statement argument or null if statement does not have argument.
-
rawArgument
public final String rawArgument()
Description copied from interface:DeclaredStatement
Returns statement argument as was present in original source.- Returns:
- statement argument as was present in original source or null, if statement does not take argument.
-
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)
-
-