Class AbstractDeclaredStatement.ArgumentToString.WithSubstatements<A>
java.lang.Object
org.opendaylight.yangtools.yang.model.api.meta.AbstractDeclaredStatement<A>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredStatement<A>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredStatement.ArgumentToString<A>
org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredStatement.ArgumentToString.WithSubstatements<A>
- All Implemented Interfaces:
DeclaredStatement<A>
,ModelStatement<A>
- Direct Known Subclasses:
RegularConfigStatement
,RegularFractionDigitsStatement
,RegularMandatoryStatement
,RegularMinElementsStatement
,RegularNamespaceStatement
,RegularPatternStatement
,RegularPositionStatement
,RegularRequireInstanceStatement
,RegularRevisionDateStatement
,RegularRevisionStatement
,RegularValueStatement
,RegularYangVersionStatement
,RegularYinElementStatement
- Enclosing class:
AbstractDeclaredStatement.ArgumentToString<A>
public abstract static class AbstractDeclaredStatement.ArgumentToString.WithSubstatements<A>
extends AbstractDeclaredStatement.ArgumentToString<A>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredStatement.ArgumentToString
AbstractDeclaredStatement.ArgumentToString.WithSubstatements<A>
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredStatement
AbstractDeclaredStatement.ArgumentToString<A>, AbstractDeclaredStatement.WithArgument<A>, AbstractDeclaredStatement.WithoutArgument, AbstractDeclaredStatement.WithQNameArgument, AbstractDeclaredStatement.WithRawArgument<A>, AbstractDeclaredStatement.WithRawStringArgument
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
WithSubstatements
(A argument, ImmutableList<? extends DeclaredStatement<?>> substatements) -
Method Summary
Modifier and TypeMethodDescriptionprotected MoreObjects.ToStringHelper
final ImmutableList
<? extends DeclaredStatement<?>> Returns collection of explicitly declared child statements, while preserving its original ordering from original source.final boolean
final int
hashCode()
protected static final @NonNull Object
maskList
(ImmutableList<?> list) Utility method for squashing singleton lists into single objects.protected static final @NonNull Object
maskSet
(ImmutableSet<?> set) final String
toString()
protected static final <T> @NonNull ImmutableList
<T> unmaskList
(@NonNull Object masked, @NonNull Class<T> type) Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.protected static final <T> @NonNull ImmutableSet
<T> Methods inherited from class org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredStatement.ArgumentToString
argument, rawArgument
Methods inherited from class org.opendaylight.yangtools.yang.model.api.meta.AbstractDeclaredStatement
unmaskList
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement
declarationReference, declaredSubstatements, findFirstDeclaredSubstatement, findFirstDeclaredSubstatementArgument, streamDeclaredSubstatements
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
statementDefinition
-
Constructor Details
-
WithSubstatements
protected WithSubstatements(A argument, ImmutableList<? extends DeclaredStatement<?>> substatements)
-
-
Method Details
-
declaredSubstatements
Description copied from interface:DeclaredStatement
Returns collection of explicitly declared child statements, while preserving its original ordering from original source.- Specified by:
declaredSubstatements
in interfaceDeclaredStatement<A>
- Overrides:
declaredSubstatements
in classAbstractDeclaredStatement<A>
- Returns:
- Collection of statements, which were explicitly declared in source of model.
-
hashCode
public final int hashCode() -
equals
-
toString
-
addToStringAttributes
-
maskList
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
-
unmaskSet
protected static final <T> @NonNull ImmutableSet<T> unmaskSet(@NonNull Object masked, @NonNull Class<T> type)
-