Package com.exonum.binding.core.runtime
Class ReflectiveModuleSupplier
java.lang.Object
com.exonum.binding.core.runtime.ReflectiveModuleSupplier
- All Implemented Interfaces:
java.util.function.Supplier<ServiceModule>
public final class ReflectiveModuleSupplier extends java.lang.Object implements java.util.function.Supplier<ServiceModule>
A reflective supplier of service modules that instantiates them with a no-arg constructor.
-
Constructor Summary
Constructors Constructor Description ReflectiveModuleSupplier(java.lang.Class<? extends ServiceModule> moduleClass)
Creates a module supplier for a given service module class. -
Method Summary
Modifier and Type Method Description ServiceModule
get()
java.lang.String
toString()
-
Constructor Details
-
ReflectiveModuleSupplier
public ReflectiveModuleSupplier(java.lang.Class<? extends ServiceModule> moduleClass) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessExceptionCreates a module supplier for a given service module class.- Throws:
java.lang.NoSuchMethodException
- if the constructor of given service module class does not existjava.lang.IllegalAccessException
- if accessing the no-arg module constructor failed
-
-
Method Details
-
get
- Specified by:
get
in interfacejava.util.function.Supplier<ServiceModule>
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-