com.xlrit.gears.base.event.ElementEvent Maven / Gradle / Ivy
package com.xlrit.gears.base.event;
import org.springframework.core.ResolvableType;
import org.springframework.core.ResolvableTypeProvider;
public abstract class ElementEvent implements ResolvableTypeProvider {
protected final String kind;
protected final Class type;
protected final T element;
protected ElementEvent(String kind, Class type, T element) {
this.kind = kind;
this.type = type;
this.element = element;
}
public String getKind() {
return kind;
}
public T getElement() {
return element;
}
public Class getType() {
return type;
}
@Override
public ResolvableType getResolvableType() {
return ResolvableType.forClassWithGenerics(getClass(), type);
}
@Override
public String toString() {
return getClass().getSimpleName() + "[" +
", type=" + type +
", element=" + element +
']';
}
}