com.cryptomorin.xseries.reflection.Handle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of XSeries Show documentation
Show all versions of XSeries Show documentation
A set of utilities for Minecraft plugins
package com.cryptomorin.xseries.reflection;
public interface Handle {
default boolean exists() {
try {
reflect();
return true;
} catch (ReflectiveOperationException ignored) {
return false;
}
}
default ReflectiveOperationException catchError() {
try {
reflect();
return null;
} catch (ReflectiveOperationException ex) {
return ex;
}
}
default T unreflect() {
try {
return reflect();
} catch (ReflectiveOperationException e) {
throw XReflection.throwCheckedException(e);
}
}
default T reflectOrNull() {
try {
return reflect();
} catch (ReflectiveOperationException ignored) {
return null;
}
}
T reflect() throws ReflectiveOperationException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy