public class Subtypes
extends java.lang.Object
Constructor | Description |
---|---|
Subtypes() |
Modifier and Type | Method | Description |
---|---|---|
static boolean |
applySubtype(Disguise disguise,
java.lang.String argument) |
Applies a subtype to a given disguise based on the given argument.
|
static java.util.Set<java.lang.String> |
listSubtypeArguments(Disguise disguise,
boolean includeParameterSuggestions) |
Returns a set containing all registered subtype arguments for the given disguise.
|
static void |
registerParameterizedSubtype(java.lang.Class<? extends Disguise> disguiseClass,
java.lang.String methodName,
java.lang.String argument,
java.lang.Class<?> parameterType) |
Registers a new parameterized subtype.
|
static void |
registerParameterizedSubtype(java.lang.Class<? extends Disguise> disguiseClass,
java.lang.String methodName,
java.lang.String argument,
java.lang.Class<?> parameterType,
java.util.Set<java.lang.String> parameterSuggestions) |
Registers a new parameterized subtype.
|
static void |
registerSubtype(java.lang.Class<? extends Disguise> disguiseClass,
java.lang.String methodName,
boolean parameter,
java.lang.String argument) |
Registers a new subtype.
|
static void |
registerSubtype(java.lang.Class<? extends Disguise> disguiseClass,
java.lang.String methodName,
int parameter,
java.lang.String argument) |
Registers a new subtype.
|
static void |
registerSubtype(java.lang.Class<? extends Disguise> disguiseClass,
java.lang.String methodName,
java.lang.Object parameter,
java.lang.String argument) |
Registers a new subtype.
|
public static void registerSubtype(java.lang.Class<? extends Disguise> disguiseClass, java.lang.String methodName, java.lang.Object parameter, java.lang.String argument)
disguiseClass
- the disguise classmethodName
- the method to callparameter
- the parameter to pass to the methodargument
- the command argument to bind this topublic static void registerSubtype(java.lang.Class<? extends Disguise> disguiseClass, java.lang.String methodName, boolean parameter, java.lang.String argument)
disguiseClass
- the disguise classmethodName
- the method to callparameter
- the parameter to pass to the methodargument
- the command argument to bind this topublic static void registerSubtype(java.lang.Class<? extends Disguise> disguiseClass, java.lang.String methodName, int parameter, java.lang.String argument)
disguiseClass
- the disguise classmethodName
- the method to callparameter
- the parameter to pass to the methodargument
- the command argument to bind this topublic static void registerParameterizedSubtype(java.lang.Class<? extends Disguise> disguiseClass, java.lang.String methodName, java.lang.String argument, java.lang.Class<?> parameterType)
disguiseClass
- the disguise classmethodName
- the method to callargument
- the command argument to bind this toparameterType
- the parameter type to pass to the method (int.class
, float.class
, String.class
, String[].class
and enum classes are supported)public static void registerParameterizedSubtype(java.lang.Class<? extends Disguise> disguiseClass, java.lang.String methodName, java.lang.String argument, java.lang.Class<?> parameterType, java.util.Set<java.lang.String> parameterSuggestions)
registerParameterizedSubtype(Class, String, String, Class)
public static boolean applySubtype(Disguise disguise, java.lang.String argument)
disguise
- the disguiseargument
- the argument to matchtrue
, if and only if a matching subtype has been found AND successfully appliedpublic static java.util.Set<java.lang.String> listSubtypeArguments(Disguise disguise, boolean includeParameterSuggestions)