Class EffectiveStatementBase<A,​D extends DeclaredStatement<A>>

    • Constructor Detail

      • EffectiveStatementBase

        protected EffectiveStatementBase​(StmtContext<A,​D,​?> ctx)
        Constructor.
        Parameters:
        ctx - context of statement.
    • Method Detail

      • initSubstatements

        protected Collection<? extends EffectiveStatement<?,​?>> initSubstatements​(Collection<? extends StmtContext<?,​?,​?>> substatementsInit)
        Create a set of substatements. This method is split out so it can be overridden in ExtensionEffectiveStatementImpl to leak a not-fully-initialized instance.
        Parameters:
        substatementsInit - proposed substatements
        Returns:
        Filtered substatements
      • allSubstatementsOfType

        public final <T> Collection<T> allSubstatementsOfType​(Class<T> type)
      • firstSubstatementOfType

        protected final <T> @Nullable T firstSubstatementOfType​(Class<T> type)
      • firstSubstatementOfType

        protected final <R> R firstSubstatementOfType​(Class<?> type,
                                                      Class<R> returnType)
      • firstEffectiveSubstatementOfType

        protected final EffectiveStatement<?,​?> firstEffectiveSubstatementOfType​(Class<?> type)
      • firstSchemaNode

        protected final <S extends SchemaNode> S firstSchemaNode​(Class<S> type)
      • 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
      • unmaskSet

        protected static final <T> @NonNull ImmutableSet<? extends T> unmaskSet​(@NonNull Object masked,
                                                                                @NonNull Class<T> type)