Interface BaseDelegate<T extends BaseDelegate<? extends T>>

  • All Known Subinterfaces:
    ConcurrentBaseDelegate<T>
    All Known Implementing Classes:
    ExecutorFactory, FrameStack, RuleExecutorFactory

    public interface BaseDelegate<T extends BaseDelegate<? extends T>>
    Convenience interface for classes which may have a parent ("base") in order to delegate failed operations to (for example, variable lookups). Please note that such a strategy requires synchronisation or immutability in concurrent use cases. For example, if a collection in the parent is modified when a lookup is being delegated by a child, this can lead to ConcurrentModificationException. To mitigate this, a synchronized version of delegate methods are provided.
    Since:
    1.6
    Author:
    Sina Madani
    • Method Detail

      • getBase

        T getBase()
      • mergeCollectionsUnique

        default <C> void mergeCollectionsUnique​(java.util.function.Function<T,​java.util.Collection<C>> colPropertyGetter,
                                                java.util.function.Supplier<? extends java.util.Collection<C>> targetColSup,
                                                BaseDelegate.MergeMode mode)
      • delegateLookup

        default <R> R delegateLookup​(java.util.function.Function<T,​R> method)
      • delegateLookup

        @SafeVarargs
        static <T,​R> R delegateLookup​(java.util.function.Function<T,​R> method,
                                            T... instances)
      • delegateLookup

        default <R> R delegateLookup​(java.util.function.Function<T,​R> method,
                                     boolean syncOnBase)
      • delegateLookup

        default <R> R delegateLookup​(java.util.function.Function<T,​R> method,
                                     java.util.function.Function<T,​? extends java.lang.Object> lockProperty)
      • delegateLookup

        static <T,​R> R delegateLookup​(java.util.function.Function<T,​R> method,
                                            T thisObj,
                                            T baseObj,
                                            java.lang.Object lock)