Class WorldTypeParser

java.lang.Object
net.apartium.cocoabeans.commands.parsers.ArgumentParser<T>
net.apartium.cocoabeans.commands.parsers.ContextualMapBasedParser<T>
net.apartium.cocoabeans.commands.parsers.MapBasedParser<org.bukkit.WorldType>
net.apartium.cocoabeans.commands.spigot.parsers.WorldTypeParser
All Implemented Interfaces:
Comparable<net.apartium.cocoabeans.commands.parsers.ArgumentParser<?>>

@AvailableSince("0.0.49") public class WorldTypeParser extends net.apartium.cocoabeans.commands.parsers.MapBasedParser<org.bukkit.WorldType>
A parser for mapping world type names to WorldType objects. This parser is based on a map where the keys are world type names, and the values are corresponding WorldType instances. It allows customization of keyword, priority, case sensitivity, and lax mode.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.apartium.cocoabeans.commands.parsers.ArgumentParser

    net.apartium.cocoabeans.commands.parsers.ArgumentParser.ParseResult<T extends Object>, net.apartium.cocoabeans.commands.parsers.ArgumentParser.TabCompletionResult
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldTypeParser(int priority)
    Constructs a new WorldTypeParser with the default keyword and the specified priority.
    WorldTypeParser(String keyword, int priority)
    Constructs a new WorldTypeParser with the specified keyword and priority.
    WorldTypeParser(String keyword, int priority, boolean ignoreCase)
    Constructs a new WorldTypeParser with the specified parameters.
    WorldTypeParser(String keyword, int priority, boolean ignoreCase, boolean lax)
    Constructs a new WorldTypeParser with the specified parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected net.apartium.cocoabeans.commands.parsers.exception.InvalidParserResponse
    createNoSuchElementResponse(net.apartium.cocoabeans.commands.CommandProcessingContext context, String message, String attempted)
     
    Map<String,org.bukkit.WorldType>
    Provides a map of world type names to their corresponding WorldType instances.

    Methods inherited from class net.apartium.cocoabeans.commands.parsers.MapBasedParser

    getMap

    Methods inherited from class net.apartium.cocoabeans.commands.parsers.ContextualMapBasedParser

    parse, tabCompletion, tryParse

    Methods inherited from class net.apartium.cocoabeans.commands.parsers.ArgumentParser

    compareTo, getArgumentType, getKeyword, getPriority, isSupportMultipleArguments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WorldTypeParser

      public WorldTypeParser(String keyword, int priority, boolean ignoreCase, boolean lax)
      Constructs a new WorldTypeParser with the specified parameters.
      Parameters:
      keyword - the keyword associated with this parser.
      priority - the priority of the parser, used for ordering.
      ignoreCase - whether the parser should ignore case when matching keys.
      lax - whether the parser should operate in lax mode, allowing more flexible parsing behavior.
    • WorldTypeParser

      public WorldTypeParser(String keyword, int priority, boolean ignoreCase)
      Constructs a new WorldTypeParser with the specified parameters. Assumes lax mode is disabled.
      Parameters:
      keyword - the keyword associated with this parser.
      priority - the priority of the parser, used for ordering.
      ignoreCase - whether the parser should ignore case when matching keys.
    • WorldTypeParser

      public WorldTypeParser(String keyword, int priority)
      Constructs a new WorldTypeParser with the specified keyword and priority. Assumes case sensitivity and lax mode are disabled.
      Parameters:
      keyword - the keyword associated with this parser.
      priority - the priority of the parser, used for ordering.
    • WorldTypeParser

      public WorldTypeParser(int priority)
      Constructs a new WorldTypeParser with the default keyword and the specified priority. Assumes case sensitivity and lax mode are disabled.
      Parameters:
      priority - the priority of the parser, used for ordering.
  • Method Details

    • getMap

      public Map<String,org.bukkit.WorldType> getMap()
      Provides a map of world type names to their corresponding WorldType instances.
      Specified by:
      getMap in class net.apartium.cocoabeans.commands.parsers.MapBasedParser<org.bukkit.WorldType>
      Returns:
      a Map where the keys are the names of all world types, and the values are the corresponding WorldType instances.
    • createNoSuchElementResponse

      protected net.apartium.cocoabeans.commands.parsers.exception.InvalidParserResponse createNoSuchElementResponse(net.apartium.cocoabeans.commands.CommandProcessingContext context, String message, String attempted)
      Overrides:
      createNoSuchElementResponse in class net.apartium.cocoabeans.commands.parsers.ContextualMapBasedParser<org.bukkit.WorldType>