Class AbstractEffectiveStatement<A,D extends DeclaredStatement<A>>
java.lang.Object
org.opendaylight.yangtools.yang.model.api.meta.AbstractEffectiveStatement<A,D>
- Type Parameters:
A
- Argument type (Empty
if statement does not have argument.)D
- Class representing declared version of this statement.
- All Implemented Interfaces:
EffectiveStatement<A,
,D> ModelStatement<A>
- Direct Known Subclasses:
AbstractDeclaredEffectiveStatement
,AbstractUndeclaredEffectiveStatement
public abstract non-sealed class AbstractEffectiveStatement<A,D extends DeclaredStatement<A>>
extends Object
implements EffectiveStatement<A,D>
Abstract base class for
EffectiveStatement
implementations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MoreObjects.ToStringHelper
final boolean
protected static final <E> @NonNull Optional<E>
filterOptional
(@NonNull Optional<?> optional, @NonNull Class<E> type) protected static final <K,
V> @NonNull Optional<V> 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 @NonNull ImmutableList<? extends @NonNull EffectiveStatement<?,
?>> unmaskList
(@NonNull Object masked) Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement
collectEffectiveSubstatements, effectiveSubstatements, findFirstEffectiveSubstatement, findFirstEffectiveSubstatementArgument, getDeclared, statementOrigin, streamEffectiveSubstatements
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.meta.ModelStatement
argument, statementDefinition
-
Constructor Details
-
AbstractEffectiveStatement
public AbstractEffectiveStatement()
-
-
Method Details
-
unmaskList
protected static final @NonNull ImmutableList<? extends @NonNull EffectiveStatement<?,?>> unmaskList(@NonNull Object masked) Utility method for recovering singleton lists squashed bymaskList(ImmutableList)
.- Parameters:
masked
- list to unmask- Returns:
- Unmasked list
- Throws:
NullPointerException
- if masked is nullClassCastException
- if masked object does not match EffectiveStatement
-
filterOptional
-
findValue
-
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)
-