Class ProxyDelegateFactory

java.lang.Object
ru.progrm_jarvis.javacommons.delegate.ProxyDelegateFactory
All Implemented Interfaces:
DelegateFactory

public final class ProxyDelegateFactory extends Object implements DelegateFactory
Implementation of delegate factory which uses runtime proxy generation via Proxy.
  • Constructor Details

  • Method Details

    • create

      @NotNull public static @NotNull DelegateFactory create()
      Creates a proxy-based delegate factory.
      Returns:
      proxy-based delegate factory
      API note
      singleton may be used here
    • createWrapper

      @NotNull public <T> T createWrapper(@NonNull @NonNull Class<T> targetType, @NonNull @NonNull Supplier<T> supplier)
      Description copied from interface: DelegateFactory
      Creates a delegating wrapper of the given type using the provided Supplier for its backend.
      Specified by:
      createWrapper in interface DelegateFactory
      Type Parameters:
      T - type of implemented wrapper
      Parameters:
      targetType - type of implemented wrapper
      supplier - supplier to handle access to the underlying object
      Returns:
      created delegating wrapper for the given supplier