EnumSimpledCoder

This commit is contained in:
redkale
2024-09-29 14:46:51 +08:00
parent b724ce1a0c
commit 0b10009d5e

View File

@@ -43,7 +43,7 @@ public final class EnumSimpledCoder<R extends Reader, W extends Writer, E extend
char[] chs = fieldName.toCharArray(); char[] chs = fieldName.toCharArray();
chs[0] = Character.toUpperCase(chs[0]); chs[0] = Character.toUpperCase(chs[0]);
String methodName = "get" + new String(chs); String methodName = "get" + new String(chs);
Method method = null; Method method;
try { try {
method = type.getMethod(methodName); method = type.getMethod(methodName);
} catch (NoSuchMethodException | SecurityException me) { } catch (NoSuchMethodException | SecurityException me) {
@@ -92,7 +92,7 @@ public final class EnumSimpledCoder<R extends Reader, W extends Writer, E extend
} }
@Override @Override
public Class<E> getType() { public Type getType() {
return (Class<E>) type; return type;
} }
} }