io.github.amayaframework.di.Repository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of amaya-di Show documentation
Show all versions of amaya-di Show documentation
A framework responsible for monitoring and automating the dependency injection process.
package io.github.amayaframework.di;
import com.github.romanqed.jfunc.Function0;
/**
* An interface describing an abstract repository of instantiators associated with the specified artifacts.
*/
public interface Repository {
/**
* Gets the instantiator associated with the specified artifact.
*
* Important:
* if null was returned, it definitely means that the instantiator was not found,
* but the opposite is NOT TRUE.
*
* For example,
*
* var func = repository.get(Artifact.of(String.class));
* System.out.println(func.invoke()); => "null"
*
* Here func is not null, but will always return null.
*
* So, to unambiguously determine whether the repository contains an artifact or not,
* use {@link Repository#contains(Artifact)}.
*
* @param artifact the specified artifact, must be non-null
* @return null or {@link Function0} instance
*/
Function0
© 2015 - 2025 Weber Informatics LLC | Privacy Policy