mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Dont need to deserialize enum if it is already an enum
This commit is contained in:
parent
9c929fccca
commit
7868a1971e
@ -43,6 +43,9 @@ public final class DefaultSerializerProvider {
|
||||
private static final NodeSerializer<Enum> ENUM_SERIALIZER = new NodeSerializer<>() {
|
||||
@Override
|
||||
public Enum<?> deserialize(Object object, Class<Enum> type) {
|
||||
if (type.isInstance(object)) {
|
||||
return (Enum<?>) object;
|
||||
}
|
||||
return Enum.valueOf(type, String.valueOf(object).toUpperCase());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user