package me.proxer.library.api;

import me.proxer.library.util.ProxerUtils;
import retrofit2.Converter;
import retrofit2.Retrofit;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

/**
 * @author Ruben Gees
 */
final class EnumRetrofitConverterFactory extends Converter.Factory {

    @Override
    public Converter<?, String> stringConverter(final Type type, final Annotation[] annotations,
                                                final Retrofit retrofit) {
        if (((Class<?>) type).isEnum()) {
            return (Converter<Enum<?>, String>) value -> ProxerUtils.getApiEnumName(value);
        }

        return null;
    }
}

@@ -575,17 +575,8 @@
 ng%3E)
- value -%3E
  Pro
@@ -583,17 +583,18 @@
 xerUtils
-.
+::
 getApiEn
@@ -603,15 +603,8 @@
 Name
-(value)
 ;%0A  

Revert "Try a lambda instead of a method reference for java 8 support"