@Override public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) { RetrofitType retrofitType = new RetrofitType(type); if (retrofitType.isValid() && serializer.isRegisteredType(retrofitType.getType())) { return new JSONAPIRequestBodyConverter<>(serializer); } else if (alternativeFactory != null) { return alternativeFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit); } else { return null; } } }
@Override public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) { RetrofitType retrofitType = new RetrofitType(type); if (retrofitType.isValid() && serializer.isRegisteredType(retrofitType.getType())) { return new JSONAPIRequestBodyConverter<>(serializer); } else if (alternativeFactory != null) { return alternativeFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit); } else { return null; } } }
@Override public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { RetrofitType retrofitType = new RetrofitType(type); if (retrofitType.isValid() && deserializer.isRegisteredType(retrofitType.getType())) { if (retrofitType.isJSONAPIDocumentType()) { return new JSONAPIDocumentResponseBodyConverter<>(deserializer, retrofitType.getType(), retrofitType.isCollection()); } else { return new JSONAPIResponseBodyConverter<>(deserializer, retrofitType.getType(), retrofitType.isCollection()); } } else if (alternativeFactory != null) { return alternativeFactory.responseBodyConverter(type, annotations, retrofit); } else { return null; } }
@Override public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { RetrofitType retrofitType = new RetrofitType(type); if (retrofitType.isValid() && deserializer.isRegisteredType(retrofitType.getType())) { if (retrofitType.isJSONAPIDocumentType()) { return new JSONAPIDocumentResponseBodyConverter<>(deserializer, retrofitType.getType(), retrofitType.isCollection()); } else { return new JSONAPIResponseBodyConverter<>(deserializer, retrofitType.getType(), retrofitType.isCollection()); } } else if (alternativeFactory != null) { return alternativeFactory.responseBodyConverter(type, annotations, retrofit); } else { return null; } }