Class FactoryClaim<C,T>

java.lang.Object
org.refcodes.decoupling.Claim
org.refcodes.decoupling.FactoryClaim<C,T>
Type Parameters:
C - The type of the Dependency claimed for fabricating instances of the given type.
T - The type of the instance to be created.
All Implemented Interfaces:
Comparable<Claim>, org.refcodes.factory.ContextTypeFactory<T,C>, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.TypeAccessor, org.refcodes.schema.Schemable

public class FactoryClaim<C,T> extends Claim implements org.refcodes.factory.ContextTypeFactory<T,C>
A FactoryClaim extends a Claim and uses a Function upon a Dependency to create (fabricate) an instance.
  • Constructor Details

  • Method Details

    • create

      public T create(C aClaim)
      Fabricates (creates) the provided instance.
      Specified by:
      create in interface org.refcodes.factory.ContextTypeFactory<C,T>
      Parameters:
      aClaim - The Dependency declaration required for fabrication.
      Returns:
      The fabricated instance.
    • getType

      public Class<C> getType()
      Returns the type of the Dependency required by this FactoryClaim instance when invoking create(Object).
      Specified by:
      getType in interface org.refcodes.mixin.TypeAccessor<C>
      Overrides:
      getType in class Claim
      Returns:
      The according type.
    • toSchema

      public DependencySchema toSchema()
      Specified by:
      toSchema in interface org.refcodes.schema.Schemable
      Overrides:
      toSchema in class Claim