[New] Added StrolchComponent.hasComponent()

This commit is contained in:
Robert von Burg 2020-02-26 09:25:28 +01:00
parent 9f4082ebf0
commit 6b7f118969
2 changed files with 20 additions and 0 deletions

View File

@ -36,6 +36,14 @@ public interface ComponentContainer {
ComponentState getState();
/**
* Returns true if the given component is registered on this container
*
* @param clazz
* the type of component to check for
*
* @return true if the component is available
*/
boolean hasComponent(Class<?> clazz);
/**

View File

@ -273,6 +273,18 @@ public class StrolchComponent {
return this.container.getComponent(clazz);
}
/**
* Returns true if the given component is registered on the {@link ComponentContainer}
*
* @param clazz
* the type of component to check for
*
* @return true if the component is available
*/
public boolean hasComponent(Class<?> clazz) {
return this.container.hasComponent(clazz);
}
/**
* Performs the given {@link PrivilegedRunnable} as the given system user
*