
com.github.thorbenkuck.di.domain.provider.MultitonGenericIdentifiableProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wire-di-runtime-environment Show documentation
Show all versions of wire-di-runtime-environment Show documentation
Easy and simple di using annotation processors
The newest version!
package com.github.thorbenkuck.di.domain.provider;
import com.github.thorbenkuck.di.runtime.WireRepository;
import org.jetbrains.annotations.NotNull;
import java.util.function.Function;
class MultitonGenericIdentifiableProvider implements IdentifiableProvider {
@NotNull
private final Function creationFunction;
@NotNull
private final Class>[] wireTypes;
@NotNull
private final Class type;
MultitonGenericIdentifiableProvider(
@NotNull final Function creationFunction,
@NotNull Class>[] wireTypes,
@NotNull Class type
) {
this.creationFunction = creationFunction;
this.type = type;
this.wireTypes = wireTypes;
}
@Override
@NotNull
public final Class> type() {
return type;
}
@Override
@NotNull
public final Class>[] wiredTypes() {
return wireTypes;
}
@Override
public final boolean isSingleton() {
return false;
}
@Override
@NotNull
public T get(@NotNull final WireRepository wiredRepository) {
return creationFunction.apply(wiredRepository);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy