Class TapirElementProxyFactory


  • @Component("tapirElementProxyFactory")
    public class TapirElementProxyFactory
    extends java.lang.Object
    Responsible or building interceptors which intercept calls to TapirElements or lists von TapirElements.
    Since:
    2.0.0
    Author:
    Oliver Libutzki <[email protected]>
    • Constructor Detail

      • TapirElementProxyFactory

        public TapirElementProxyFactory()
    • Method Detail

      • getTapirElementProxy

        public <T extends TapirElement> T getTapirElementProxy​(com.google.common.reflect.TypeToken<?> typeToken,
                                                               CacheInvalidator parentCacheInvalidator,
                                                               java.util.function.Supplier<TapirElement> query)
        Returns an intercepted instance of the TapirElement which is supplied by the given query.
        Type Parameters:
        T - The type of the TapirElement
        Parameters:
        typeToken - the type token of the TapirElement
        parentCacheInvalidator - offers the possibility to invalidate the cache of the containing tapir element(s)
        query - the query to get the TapirElement which should be intercepted
        Returns:
        the intercepted TapirElement
      • getTapirElementListProxy

        public <T extends TapirElement> T getTapirElementListProxy​(com.google.common.reflect.TypeToken<?> listElementTypeToken,
                                                                   CacheInvalidator parentCacheInvalidator,
                                                                   java.util.function.Supplier<java.util.List<TapirElement>> query)
        Returns an intercepted instance of the list of TapirElements which is supplied by the given query.
        Type Parameters:
        T - The type of the TapirElements in the list
        Parameters:
        listElementTypeToken - the type token of the TapirElements in the list
        parentCacheInvalidator - offers the possibility to invalidate the cache of the containing tapir element(s)
        query - the query to get the TapirElement list which should be intercepted
        Returns:
        the intercepted TapirElement list