Class InitializerClaim<C,T>
java.lang.Object
org.refcodes.decoupling.Claim
org.refcodes.decoupling.InitializerClaim<C,T>
- Type Parameters:
C- The type of theDependencyclaimed for setting up an instance of the given type.T- The type of the instance to be initialize.
- All Implemented Interfaces:
Comparable<Claim>, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.TypeAccessor, org.refcodes.schema.Schemable
A
InitializerClaim extends a Claim and uses a
BiFunction upon a Dependency to initialize a given instance.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasPropertyNested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor
org.refcodes.mixin.TypeAccessor.TypeBuilder<T,B>, org.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T> -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionInitializerClaim(Class<C> aType, BiFunction<T, C, T> aInitializer) Creates a newInitializerClaim.InitializerClaim(Class<C> aType, BiFunction<T, C, T> aInitializer, String aAlias) Creates a newInitializerClaim. -
Method Summary
Modifier and TypeMethodDescriptiongetType()Returns the type of theDependencyrequired by thisInitializerClaiminstance when invokinginitialize(Object, Object).initialize(C aClaim, T aInstance) Initializes the provided instance.toSchema()
-
Constructor Details
-
InitializerClaim
Creates a newInitializerClaim.- Parameters:
aType- The type of theDependencyrequired by theInitializerClaim.aInitializer- The processor to be used by theInitializerClaiminstance.
-
InitializerClaim
Creates a newInitializerClaim.- Parameters:
aType- The type of theDependencyrequired by theInitializerClaim.aInitializer- The processor to be used by theInitializerClaiminstance.aAlias- The alias for theInitializerClaim.
-
-
Method Details
-
initialize
Initializes the provided instance.- Parameters:
aClaim- TheDependencydeclaration required for initialization.aInstance- The instance to be initialized.- Returns:
- The initialized instance.
-
getType
Returns the type of theDependencyrequired by thisInitializerClaiminstance when invokinginitialize(Object, Object). -
toSchema
-