org.infinispan.cdi.common.util.ForwardingBean Maven / Gradle / Ivy
package org.infinispan.cdi.common.util;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Set;
import jakarta.enterprise.context.spi.CreationalContext;
import jakarta.enterprise.inject.spi.Bean;
import jakarta.enterprise.inject.spi.InjectionPoint;
/**
* An implementation of {@link Bean} that forwards all calls to the
* {@link #delegate()}.
*
* @param the class of the bean
* @author Pete Muir
*/
public abstract class ForwardingBean implements Bean {
/**
* All calls to this {@link Bean} instance are forwarded to the delegate
* unless overridden.
*
* @return the delegate {@link Bean}
*/
protected abstract Bean delegate();
public Class> getBeanClass() {
return delegate().getBeanClass();
}
public Set getInjectionPoints() {
return delegate().getInjectionPoints();
}
public String getName() {
return delegate().getName();
}
public Set getQualifiers() {
return delegate().getQualifiers();
}
public Class extends Annotation> getScope() {
return delegate().getScope();
}
public Set> getStereotypes() {
return delegate().getStereotypes();
}
public Set getTypes() {
return delegate().getTypes();
}
public boolean isAlternative() {
return delegate().isAlternative();
}
public boolean isNullable() {
return delegate().isNullable();
}
public T create(CreationalContext creationalContext) {
return delegate().create(creationalContext);
}
public void destroy(T instance, CreationalContext creationalContext) {
delegate().destroy(instance, creationalContext);
}
@Override
public int hashCode() {
return delegate().hashCode();
}
@Override
public boolean equals(Object obj) {
return delegate().equals(obj);
}
@Override
public String toString() {
return delegate().toString();
}
}