@@ -0,0 +1,2056 @@
+package com.pcloud.networking;%0A%0Aimport com.pcloud.protocol.streaming.ProtocolReader;%0Aimport com.pcloud.protocol.streaming.ProtocolWriter;%0A%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aclass EnumTypeAdapter%3CT extends Enum%3CT%3E%3E extends TypeAdapter%3CT%3E %7B%0A    private final Class%3CT%3E enumType;%0A    private final Map%3CString, T%3E nameToConstantMap;%0A    private final Map%3CT, String%3E constantToNameMap;%0A%0A    public EnumTypeAdapter(Class%3CT%3E enumType) %7B%0A        this.enumType = enumType;%0A        try %7B%0A            T%5B%5Dconstants = enumType.getEnumConstants();%0A            this.nameToConstantMap = new HashMap%3C%3E(constants.length);%0A            this.constantToNameMap = new HashMap%3C%3E(constants.length);%0A            for (int i = 0; i %3C constants.length; i++) %7B%0A                T constant = constants%5Bi%5D;%0A                ParameterValue annotation = enumType.getField(constant.name()).getAnnotation(ParameterValue.class);%0A                String name = annotation != null && !annotation.value().equals(ParameterValue.DEFAULT_NAME) ?%0A                        annotation.value() : constant.name();%0A                nameToConstantMap.put(name, constant);%0A                constantToNameMap.put(constant, name);%0A            %7D%0A        %7D catch (NoSuchFieldException e) %7B%0A            throw new AssertionError(%22Missing field in %22 + enumType.getName(), e);%0A        %7D%0A    %7D%0A%0A%0A%0A    @Override%0A    public T deserialize(ProtocolReader reader) throws IOException %7B%0A        String name = reader.readString();%0A        T enumConstant = nameToConstantMap.get(name);%0A        if (enumConstant != null)%7B%0A            return enumConstant;%0A        %7D else %7B%0A            throw new IOException(%22Expected one of%22 + nameToConstantMap.keySet() + %22but was '%22 + name + %22'%22);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void serialize(ProtocolWriter writer, T value) throws IOException %7B%0A        String name = constantToNameMap.get(value);%0A        writer.writeValue(name);%0A    %7D%0A%0A    @Override public String toString() %7B%0A        return %22JsonAdapter(%22 + enumType.getName() + %22)%22;%0A    %7D%0A%7D

Add an Enum<?> type adapter