Class AnnotationArgumentDecorator<S extends CommandSource>
java.lang.Object
studio.mevera.imperat.command.arguments.InputArgument<S>
studio.mevera.imperat.annotations.parameters.AnnotationArgumentDecorator<S>
- All Implemented Interfaces:
AnnotatedArgument<S>,Argument<S>,DescriptionHolder,PermissionHolder
public final class AnnotationArgumentDecorator<S extends CommandSource>
extends InputArgument<S>
implements AnnotatedArgument<S>
-
Field Summary
Fields inherited from class studio.mevera.imperat.command.arguments.InputArgument
defaultValueProvider, description, flag, format, greedy, index, name, optional, parentCommand, permissionsData, suggestionProvider, type -
Method Summary
Modifier and TypeMethodDescriptionCasts the parameter to a flag parameterstatic <S extends CommandSource>
AnnotationArgumentDecorator<S>decorate(Argument<S> parameter, ParameterElement element) format()Formats the usage parameter*<A extends Annotation>
AgetAnnotation(Class<A> clazz) Get the instance of specific annotation@Unmodifiable Collection<? extends Annotation>@NotNull ParseElement<?>booleanisFlag()Methods inherited from class studio.mevera.imperat.command.arguments.InputArgument
addValidator, asCommand, describe, equals, getDefaultValueSupplier, getDescription, getName, getParent, getPermissionsData, getPosition, getSuggestionResolver, getValidators, hashCode, isGreedy, isGreedyString, isOptional, setFormat, setParent, setPermissionData, setPosition, similarTo, toString, type, validate, wrappedTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface studio.mevera.imperat.annotations.parameters.AnnotatedArgument
hasAnnotationMethods inherited from interface studio.mevera.imperat.command.arguments.Argument
addValidator, asAnnotatedArgument, asCommand, getDefaultValueSupplier, getName, getParent, getPosition, getSuggestionResolver, getValidators, greedyLimit, isAnnotated, isCommand, isGreedy, isGreedyString, isNumeric, isOptional, isRequired, setFormat, setParent, setPosition, similarTo, type, validate, valueType, wrappedTypeMethods inherited from interface studio.mevera.imperat.command.DescriptionHolder
describe, describe, getDescriptionMethods inherited from interface studio.mevera.imperat.permissions.PermissionHolder
getPermissionsData, getPrimaryPermission, setPermissionData
-
Method Details
-
decorate
public static <S extends CommandSource> AnnotationArgumentDecorator<S> decorate(Argument<S> parameter, ParameterElement element) -
getParsedElement
- Specified by:
getParsedElementin interfaceAnnotatedArgument<S extends CommandSource>
-
getAnnotation
Get the instance of specific annotation- Specified by:
getAnnotationin interfaceAnnotatedArgument<S extends CommandSource>- Type Parameters:
A- the valueType of the annotation- Parameters:
clazz- the valueType of annotation- Returns:
- the specific instance of an annotation of a certain valueType AnnotationArgumentDecorator
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatedArgument<S extends CommandSource>- Returns:
- the annotations associated with this parameter
-
format
Formats the usage parameter*- Specified by:
formatin interfaceArgument<S extends CommandSource>- Overrides:
formatin classInputArgument<S extends CommandSource>- Returns:
- the formatted parameter
- See Also:
-
asFlagParameter
Casts the parameter to a flag parameter- Specified by:
asFlagParameterin interfaceArgument<S extends CommandSource>- Overrides:
asFlagParameterin classInputArgument<S extends CommandSource>- Returns:
- the parameter as a flag
-
isFlag
public boolean isFlag()- Specified by:
isFlagin interfaceArgument<S extends CommandSource>- Overrides:
isFlagin classInputArgument<S extends CommandSource>- Returns:
- checks whether this parameter is a flag
-
asNumeric
- Specified by:
asNumericin interfaceArgument<S extends CommandSource>
-