Class FallbackStubFactory
java.lang.Object
net.devh.boot.grpc.client.stubfactory.FallbackStubFactory
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAbstractStub<?>
createStub
(Class<? extends AbstractStub<?>> stubType, Channel channel) Creates a stub of the given type.boolean
isApplicable
(Class<? extends AbstractStub<?>> stubType) Used to resolve a factory that matches the particular stub type.
-
Constructor Details
-
FallbackStubFactory
public FallbackStubFactory()
-
-
Method Details
-
isApplicable
Description copied from interface:StubFactory
Used to resolve a factory that matches the particular stub type.- Specified by:
isApplicable
in interfaceStubFactory
- 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
Description copied from interface:StubFactory
Creates a stub of the given type.- Specified by:
createStub
in interfaceStubFactory
- Parameters:
stubType
- The type of the stub to create.channel
- The channel used to create the stub.- Returns:
- The newly created stub.
-