From e9fbfcac708898bf94bbe9c558a56319d2a90b6b Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 25 Mar 2021 12:38:42 +0100 Subject: [PATCH] Remove SWCommandUtils.mapper --- .../de/steamwar/command/SWCommandUtils.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java index c15ee14..5322a14 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java @@ -199,28 +199,6 @@ class SWCommandUtils { return arguments; } - @SuppressWarnings("unchecked") - private static Function mapper(Parameter parameter) { - Class clazz = parameter.getType(); - if (parameter.isVarArgs()) { - clazz = clazz.getComponentType(); - } - - if (clazz.isEnum()) { - Class> enumClass = (Class>) clazz; - return s -> ENUM_MAPPER.apply(enumClass, s); - } - - String name = clazz.getTypeName(); - SWCommand.Mapper mapper = parameter.getAnnotation(SWCommand.Mapper.class); - if (mapper != null) { - name = mapper.mapper(); - } - - TypeMapper typeMapper = MAPPER_FUNCTIONS.getOrDefault(name, ERROR_FUNCTION); - return typeMapper::map; - } - public static void addMapper(String name, TypeMapper mapper) { if (MAPPER_FUNCTIONS.containsKey(name)) return; MAPPER_FUNCTIONS.put(name, mapper);