Class FallbackStubFactory

java.lang.Object
net.devh.boot.grpc.client.stubfactory.FallbackStubFactory
All Implemented Interfaces:
StubFactory

public final class FallbackStubFactory extends Object implements StubFactory
The StubFactory which tries to find a suitable factory method or constructor as a last resort. This factory will always be the last one that is attempted.
  • Constructor Details

    • FallbackStubFactory

      public FallbackStubFactory()
  • Method Details

    • isApplicable

      public boolean isApplicable(Class<? extends AbstractStub<?>> stubType)
      Description copied from interface: StubFactory
      Used to resolve a factory that matches the particular stub type.
      Specified by:
      isApplicable in interface StubFactory
      Parameters:
      stubType - The type of the stub that needs to be created.
      Returns:
      True if this particular factory is capable of creating instances of this stub type. False otherwise.
    • createStub

      public AbstractStub<?> createStub(Class<? extends AbstractStub<?>> stubType, Channel channel)
      Description copied from interface: StubFactory
      Creates a stub of the given type.
      Specified by:
      createStub in interface StubFactory
      Parameters:
      stubType - The type of the stub to create.
      channel - The channel used to create the stub.
      Returns:
      The newly created stub.