Record Class StringArgumentType<C extends CommandContext<C>>

java.lang.Object
java.lang.Record
site.lab0x13.scrow.commands.model.argument.types.StringArgumentType<C>
All Implemented Interfaces:
ArgumentType<C,String>

public record StringArgumentType<C extends CommandContext<C>>(boolean greedy) extends Record implements ArgumentType<C,String>
  • Constructor Details

    • StringArgumentType

      public StringArgumentType()
    • StringArgumentType

      public StringArgumentType(boolean greedy)
      Creates an instance of a StringArgumentType record class.
      Parameters:
      greedy - the value for the greedy record component
  • Method Details

    • parseInput

      public com.leakyabstractions.result.api.Result<String,String> parseInput(String string)
      Specified by:
      parseInput in interface ArgumentType<C extends CommandContext<C>, String>
    • defaultSuggestionProvider

      public SuggestionProvider<C> defaultSuggestionProvider()
      Specified by:
      defaultSuggestionProvider in interface ArgumentType<C extends CommandContext<C>, String>
      Returns:
      default suggestion provider for the argument, if not overwritten by the argument
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • greedy

      public boolean greedy()
      Returns the value of the greedy record component.
      Specified by:
      greedy in interface ArgumentType<C extends CommandContext<C>, String>
      Returns:
      the value of the greedy record component