Class ContentParser<C,T extends mindustry.ctype.MappableContent>

java.lang.Object
com.xpdustry.distributor.api.command.cloud.parser.ContentParser<C,T>
Type Parameters:
C - the command sender type
T - the content type
All Implemented Interfaces:
org.incendo.cloud.parser.ArgumentParser<C,T>, org.incendo.cloud.suggestion.SuggestionProviderHolder<C>

public final class ContentParser<C,T extends mindustry.ctype.MappableContent> extends Object implements org.incendo.cloud.parser.ArgumentParser<C,T>
A parser for content arguments. Will only succeed on exact matches.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    An exception thrown when a content argument could not be parsed.

    Nested classes/interfaces inherited from interface org.incendo.cloud.parser.ArgumentParser

    org.incendo.cloud.parser.ArgumentParser.FutureArgumentParser<C extends Object,T extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContentParser(com.xpdustry.distributor.api.key.CTypeKey<T> contentType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C, T extends mindustry.ctype.MappableContent>
    org.incendo.cloud.component.CommandComponent.Builder<C,T>
    contentComponent(com.xpdustry.distributor.api.key.CTypeKey<T> contentType)
     
    static <C, T extends mindustry.ctype.MappableContent>
    org.incendo.cloud.parser.ParserDescriptor<C,T>
    contentParser(com.xpdustry.distributor.api.key.CTypeKey<T> contentType)
     
    org.incendo.cloud.parser.ArgumentParseResult<T>
    parse(org.incendo.cloud.context.CommandContext<C> ctx, org.incendo.cloud.context.CommandInput input)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.incendo.cloud.parser.ArgumentParser

    flatMap, flatMapSuccess, mapSuccess, parseFuture, suggestionProvider
  • Constructor Details

    • ContentParser

      public ContentParser(com.xpdustry.distributor.api.key.CTypeKey<T> contentType)
  • Method Details

    • contentParser

      public static <C, T extends mindustry.ctype.MappableContent> org.incendo.cloud.parser.ParserDescriptor<C,T> contentParser(com.xpdustry.distributor.api.key.CTypeKey<T> contentType)
    • contentComponent

      public static <C, T extends mindustry.ctype.MappableContent> org.incendo.cloud.component.CommandComponent.Builder<C,T> contentComponent(com.xpdustry.distributor.api.key.CTypeKey<T> contentType)
    • parse

      public org.incendo.cloud.parser.ArgumentParseResult<T> parse(org.incendo.cloud.context.CommandContext<C> ctx, org.incendo.cloud.context.CommandInput input)
      Specified by:
      parse in interface org.incendo.cloud.parser.ArgumentParser<C,T extends mindustry.ctype.MappableContent>