io.smallrye.beanbag.BeanDefinition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smallrye-beanbag Show documentation
Show all versions of smallrye-beanbag Show documentation
A trivial programmatic bean container implementation
The newest version!
package io.smallrye.beanbag;
import java.util.Set;
/**
* The formal definition of a bean.
*/
final class BeanDefinition {
private final String name;
private final int priority;
private final Class type;
private final Set> restrictedTypes;
private final BeanSupplier supplier;
BeanDefinition(final String name, final int priority, final Class type, final Set> restrictedTypes,
final BeanSupplier supplier) {
this.name = name;
this.priority = priority;
this.type = type;
this.restrictedTypes = restrictedTypes;
this.supplier = supplier;
}
public String getName() {
return name;
}
public int getPriority() {
return priority;
}
public Class getType() {
return type;
}
public Set> getRestrictedTypes() {
return restrictedTypes;
}
public BeanSupplier getBeanSupplier() {
return supplier;
}
public String toString() {
return "Definition for " + getType() + ", name=" + getName() + ", types=" + getRestrictedTypes();
}
}