Class SenderTypeRegistry

java.lang.Object
io.github.projectunified.craftcommand.processor.SenderTypeRegistry

public class SenderTypeRegistry extends Object
Registry for sender types supported by a platform.

Replaces the scattered isSenderType() and isSenderBaseType() overrides across platform processors. Each platform registers its supported sender types once, and the base processor delegates to this registry.

  • Constructor Details

    • SenderTypeRegistry

      public SenderTypeRegistry()
  • Method Details

    • registerSenderBaseType

      public void registerSenderBaseType(String typeName)
      Register the platform's base sender type (e.g. CommandSourceStack, CommandSender). This is the type that the platform natively provides.
    • registerSenderType

      public void registerSenderType(String typeName)
      Register a sender type that can be obtained from the base type (e.g. Player, CommandSender — extracted via getSender() and cast).
    • isSenderBaseType

      public boolean isSenderBaseType(com.palantir.javapoet.TypeName type)
      Returns:
      true if the type is the platform's base sender type
    • isSenderType

      public boolean isSenderType(com.palantir.javapoet.TypeName type)
      Returns:
      true if the type is any recognized sender type (base or obtainable from it)