Added type-safe version of Item#getBase

This commit is contained in:
Collin Smith 2020-09-04 21:54:40 -07:00
parent e0f977f8a0
commit 82d08989d1

View File

@ -238,6 +238,11 @@ public class Item {
return (T) base;
}
@SuppressWarnings("unchecked")
public <T extends ItemEntry> T getBase(Class<T> clazz) {
return (T) base;
}
public boolean isBase(Class type) {
return base.getClass().isAssignableFrom(type);
}