// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/ArrayDeserializer.java
// public interface ArrayDeserializer<T> {
// 
//     T deserialize(ArrayValues values);
// 
// }
// 
// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/DeserializationContext.java
// public final class DeserializationContext {
// 
//     private final Map<Class<?>, StructDeserializer<?>> structDeserializers = new HashMap<>();
//     private final Map<Class<?>, ArrayDeserializer<?>> arrayDeserializers = new HashMap<>();
// 
//     public boolean hasStructDeserializer(Class<?> type) {
//         return structDeserializers.containsKey(type);
//     }
// 
//     public <T> void addStructDeserializer(Class<T> clazz, StructDeserializer<T> structDeserializer) {
//         structDeserializers.put(clazz, structDeserializer);
//     }
// 
//     @SuppressWarnings("unchecked") // Type parity between map key and deserializer is enforced during addition
//     public <T> StructDeserializer<T> structDeserializer(Class<T> type) {
//         return (StructDeserializer<T>) structDeserializers.get(type);
//     }
// 
//     public boolean hasArrayDeserializer(Class<?> type) {
//         return arrayDeserializers.containsKey(type);
//     }
// 
//     public <T> void addArrayDeserializer(Class<T> clazz, ArrayDeserializer<T> arrayDeserializer) {
//         arrayDeserializers.put(clazz, arrayDeserializer);
//     }
// 
//     @SuppressWarnings("unchecked") // Type parity between map key and deserializer is enforced during addition
//     public <T> ArrayDeserializer<T> arrayDeserializer(Class<T> type) {
//         return (ArrayDeserializer<T>) arrayDeserializers.get(type);
//     }
// 
// }
// 
// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/SimplefiedTreeStrategy.java
// public class SimplefiedTreeStrategy extends TreeStrategy {
// 
//     @Override
//     public boolean write(Type type, Object value, NodeMap node, Map map) {
//         return false;
//     }
// 
// }
// 
// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/StructDeserializer.java
// public interface StructDeserializer<T> {
// 
//     T deserialize(StructMembers members);
// 
// }


import nl.nl2312.xmlrpc.deserialization.ArrayDeserializer;
import nl.nl2312.xmlrpc.deserialization.DeserializationContext;
import nl.nl2312.xmlrpc.deserialization.SimplefiedTreeStrategy;
import nl.nl2312.xmlrpc.deserialization.StructDeserializer;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.convert.AnnotationStrategy;
import org.simpleframework.xml.core.Persister;
import org.simpleframework.xml.strategy.TreeStrategy;
import retrofit2.Converter;
import retrofit2.Retrofit;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
        }
        return new XmlRpcRequestBodyConverter<>(serializer, annotation.value());
    }

    @Override
    public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
        XmlRpc annotation = getAnnotation(annotations);
        if (annotation == null) {
            return null;
        }
        return new XmlRpcResponseBodyConverter<>(serializer, context, type);
    }

    private XmlRpc getAnnotation(Annotation[] annotations) {
        if (annotations != null) {
            for (Annotation annotation : annotations) {
                if (annotation instanceof XmlRpc) {
                    return (XmlRpc) annotation;
                }
            }
        }
        return null;
    }

    public static class Builder {

        private DeserializationContext context = new DeserializationContext();

        public Converter.Factory create() {
            // Use annotations, if any, or write using a tree, but never write any extra 'class' or 'length' attributes
// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/ArrayDeserializer.java
// public interface ArrayDeserializer<T> {
// 
//     T deserialize(ArrayValues values);
// 
// }
// 
// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/DeserializationContext.java
// public final class DeserializationContext {
// 
//     private final Map<Class<?>, StructDeserializer<?>> structDeserializers = new HashMap<>();
//     private final Map<Class<?>, ArrayDeserializer<?>> arrayDeserializers = new HashMap<>();
// 
//     public boolean hasStructDeserializer(Class<?> type) {
//         return structDeserializers.containsKey(type);
//     }
// 
//     public <T> void addStructDeserializer(Class<T> clazz, StructDeserializer<T> structDeserializer) {
//         structDeserializers.put(clazz, structDeserializer);
//     }
// 
//     @SuppressWarnings("unchecked") // Type parity between map key and deserializer is enforced during addition
//     public <T> StructDeserializer<T> structDeserializer(Class<T> type) {
//         return (StructDeserializer<T>) structDeserializers.get(type);
//     }
// 
//     public boolean hasArrayDeserializer(Class<?> type) {
//         return arrayDeserializers.containsKey(type);
//     }
// 
//     public <T> void addArrayDeserializer(Class<T> clazz, ArrayDeserializer<T> arrayDeserializer) {
//         arrayDeserializers.put(clazz, arrayDeserializer);
//     }
// 
//     @SuppressWarnings("unchecked") // Type parity between map key and deserializer is enforced during addition
//     public <T> ArrayDeserializer<T> arrayDeserializer(Class<T> type) {
//         return (ArrayDeserializer<T>) arrayDeserializers.get(type);
//     }
// 
// }
// 
// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/SimplefiedTreeStrategy.java
// public class SimplefiedTreeStrategy extends TreeStrategy {
// 
//     @Override
//     public boolean write(Type type, Object value, NodeMap node, Map map) {
//         return false;
//     }
// 
// }
// 
// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/deserialization/StructDeserializer.java
// public interface StructDeserializer<T> {
// 
//     T deserialize(StructMembers members);
// 
// }


// Path: xmlrpc/src/main/java/nl/nl2312/xmlrpc/XmlRpcConverterFactory.java
import nl.nl2312.xmlrpc.deserialization.ArrayDeserializer;
import nl.nl2312.xmlrpc.deserialization.DeserializationContext;
import nl.nl2312.xmlrpc.deserialization.SimplefiedTreeStrategy;
import nl.nl2312.xmlrpc.deserialization.StructDeserializer;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.convert.AnnotationStrategy;
import org.simpleframework.xml.core.Persister;
import org.simpleframework.xml.strategy.TreeStrategy;
import retrofit2.Converter;
import retrofit2.Retrofit;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

        }
        return new XmlRpcRequestBodyConverter<>(serializer, annotation.value());
    }

    @Override
    public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
        XmlRpc annotation = getAnnotation(annotations);
        if (annotation == null) {
            return null;
        }
        return new XmlRpcResponseBodyConverter<>(serializer, context, type);
    }

    private XmlRpc getAnnotation(Annotation[] annotations) {
        if (annotations != null) {
            for (Annotation annotation : annotations) {
                if (annotation instanceof XmlRpc) {
                    return (XmlRpc) annotation;
                }
            }
        }
        return null;
    }

    public static class Builder {

        private DeserializationContext context = new DeserializationContext();

        public Converter.Factory create() {
            // Use annotations, if any, or write using a tree, but never write any extra 'class' or 'length' attributes
            AnnotationStrategy strategy = new AnnotationStrategy(new SimplefiedTreeStrategy());