Class AbstractServiceFactory<T,​C extends ServiceConfiguration>

java.lang.Object
com.kryptokrauts.aeternity.sdk.service.AbstractServiceFactory<T,​C>
Type Parameters:
T - the service interface to be retrieved
C - a pojo containing a set of service parameters with defaults, also see ServiceConfiguration
Direct Known Subclasses:
AeternityServiceFactory, DelegationServiceFactory, KeyPairServiceFactory, KeystoreServiceFactory

public abstract class AbstractServiceFactory<T,​C extends ServiceConfiguration>
extends java.lang.Object
This abstract factory defines the uniform process of retrieving service implementations.
  • Constructor Summary

    Constructors
    Constructor Description
    AbstractServiceFactory()  
  • Method Summary

    Modifier and Type Method Description
    abstract T getService()  
    T getService​(C config)  
    protected abstract T getServiceWithConfig​(C config)
    this method must be provided by the concrete factory to create a service instance with the concrete service configuration

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractServiceFactory

      public AbstractServiceFactory()
  • Method Details

    • getService

      public abstract T getService()
      Returns:
      a singleton instance of the service class with default configuration
    • getService

      public T getService​(C config)
      Parameters:
      config - the configuration pojo
      Returns:
      a singleton instance of the service class with the given configuration. all further calls to this method with the same config object will return the same instance
    • getServiceWithConfig

      protected abstract T getServiceWithConfig​(C config)
      this method must be provided by the concrete factory to create a service instance with the concrete service configuration
      Parameters:
      config - the configuration pojo
      Returns:
      the concrete factory implementation