Class ClassFilter

java.lang.Object
org.geysermc.conduit.ClassFilter

public class ClassFilter extends Object
Selects classes for ConduitContext.scanClasses(ClassFilter). Conditions are combined with and.
ClassFilter.filter()
        .inPackage("com.example")
        .implementsInterface("com.example.api.Plugin")
        .extendsClass("com.example.Base").not();
  • Method Details

    • implementsInterface

      public ClassFilter implementsInterface(Class<?> interfaceClass)
      Matches classes implementing an interface, directly or through a superclass or superinterface.
      Parameters:
      interfaceClass - the interface
      Returns:
      this filter
    • implementsInterface

      public ClassFilter implementsInterface(String interfaceName)
      Matches classes implementing an interface, directly or through a superclass or superinterface.
      Parameters:
      interfaceName - the binary name of the interface
      Returns:
      this filter
      See Also:
    • extendsClass

      public ClassFilter extendsClass(Class<?> superClass)
      Matches classes extending a class, directly or indirectly.
      Parameters:
      superClass - the superclass
      Returns:
      this filter
    • extendsClass

      public ClassFilter extendsClass(String superClassName)
      Matches classes extending a class, directly or indirectly.
      Parameters:
      superClassName - the binary name of the superclass
      Returns:
      this filter
      See Also:
    • inPackage

      public ClassFilter inPackage(String packageName)
      Matches classes in a package or any of its subpackages.
      Parameters:
      packageName - the package name
      Returns:
      this filter
    • not

      public ClassFilter not()
      Inverts the condition added last.
      Returns:
      this filter
      Throws:
      IllegalStateException - if no condition has been added
    • filter

      public static ClassFilter filter()
      Creates a filter with no conditions.
      Returns:
      a filter matching every class