Class DefaultConnectorFactoryDescriptor.SingleProtocolAdapterSupplier<O,I,CO,CI>

java.lang.Object
de.iip_ecosphere.platform.connectors.DefaultConnectorFactoryDescriptor.ProtocolAdapterSupplier<O,I,CO,CI>
de.iip_ecosphere.platform.connectors.DefaultConnectorFactoryDescriptor.SingleProtocolAdapterSupplier<O,I,CO,CI>
Type Parameters:
O - the output type from the underlying machine/platform
I - the input type to the underlying machine/platform
CO - the output type of the connector
CI - the input type of the connector
Enclosing class:
DefaultConnectorFactoryDescriptor

protected static class DefaultConnectorFactoryDescriptor.SingleProtocolAdapterSupplier<O,I,CO,CI> extends DefaultConnectorFactoryDescriptor.ProtocolAdapterSupplier<O,I,CO,CI>
Type-safe protocol adapter supplier for multiple adapters. Doesn't work without as Java does not allow casting from/to a supplier with inner wildcard type parameters.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • SingleProtocolAdapterSupplier

      protected SingleProtocolAdapterSupplier(Supplier<ProtocolAdapter<O,I,CO,CI>> protoSupplier, Class<O> oClass, Class<I> iClass, Class<CO> coClass, Class<CI> ciClass)
      Creates a supplier with type instances.
      Parameters:
      protoSupplier - the supplier
      oClass - the type for O
      iClass - the type for I
      coClass - the type for CO
      ciClass - the type for CI
  • Method Details

    • get

      public <OT, IT, COT, CIT> ProtocolAdapter<OT,IT,COT,CIT>[] get(Class<OT> oClass, Class<IT> iClass, Class<COT> coClass, Class<CIT> ciClass)
      Returns an instance if apparently type-compatible.
      Specified by:
      get in class DefaultConnectorFactoryDescriptor.ProtocolAdapterSupplier<O,I,CO,CI>
      Type Parameters:
      OT - the desired output type from the underlying machine/platform
      IT - the desired input type to the underlying machine/platform
      COT - the desired output type of the connector
      CIT - the desired input type of the connector
      Parameters:
      oClass - the type for OT
      iClass - the type for IT
      coClass - the type for COT
      ciClass - the type for CIT
      Returns:
      the instance or null if it is not possible to create/cast an instance