FactoryBuilder

public final class FactoryBuilder

Constructors

Link copied to clipboard
public FactoryBuilder FactoryBuilder(    KClass<?> contractVal,     String nameVal,     CreationPattern creationPatternVal,     List<KClass<?>> injectsInVal)

Functions

Link copied to clipboard
public final FactoryBuilder constructor<T extends Any>(Function1<Warehouse, T> constructor)

this function takes a lambda with T as a return type this function lambda contains the object constructor that allows the library to construct the object when is needed

Link copied to clipboard
public final Unit contract(Function1<FactoryBuilder, KClass<?>> block)

this function takes a lambda with KClass as a return type this function specify in which form this object should be injected, and it is mainly used to hide concrete implementations

public final Unit contract(KClass<?> contract)

this function specify in which form this object should be injected, and it is mainly used to hide concrete implementations

Link copied to clipboard
public final Unit creation(CreationPattern creationPattern)
public final Unit creation(Function1<FactoryBuilder, CreationPattern> block)

this function specify how the library is going to deal with the dependency instance

Link copied to clipboard
public final Unit injectsIn(KClass<?> injectsIn)
public final Unit injectsIn(KClass<?> injectsIn)

this function specify where the given dependency is going tobe injected

public final Unit injectsIn(Function1<FactoryBuilder, KClass<?>> block)

this function takes a lambda with KClass as a return type this function specify where the given dependency is going tobe injected

Link copied to clipboard
public final Unit name(Function1<FactoryBuilder, String> block)

this function takes a lambda with string as a return type this string is used as a key for the given dependency this is useful when you have two or more dependencies of the same type

public final Unit name(String name)
Link copied to clipboard
public final V param<V extends Any>(Warehouse $self)
public final V param<V extends Any>(Warehouse $self, String name)

this function notify the library that there is a dependency here that is required for this dependency

Link copied to clipboard
public final Unit unaryPlus(String $self)

this operator takes string which is used as a key for the given dependency this is useful when you have two or more dependencies of the same type

public final Unit unaryPlus(KClass<?> $self)

this operator takes KClass which specify where the given dependency is going tobe injected