retrofit/src/main/java/retrofit2/Retrofit.java
public <T> Converter<T, RequestBody> nextRequestBodyConverter(
      @Nullable Converter.Factory skipPast, Type type, Annotation[] parameterAnnotations,
      Annotation[] methodAnnotations) {
    checkNotNull(type, "type == null");
    checkNotNull(parameterAnnotations, "parameterAnnotations == null");
    checkNotNull(methodAnnotations, "methodAnnotations == null");

    int start = converterFactories.indexOf(skipPast) + 1;
    for (int i = start, count = converterFactories.size(); i < count; i++) {
      Converter.Factory factory = converterFactories.get(i);
      Converter<?, RequestBody> converter =
          factory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, this);
      if (converter != null) {
        //noinspection unchecked
        return (Converter<T, RequestBody>) converter;
      }
    }

    StringBuilder builder = new StringBuilder("Could not locate RequestBody converter for ")
        .append(type)
        .append(".\n");
    if (skipPast != null) {
      builder.append("  Skipped:");
      for (int i = 0; i < start; i++) {
        builder.append("\n   * ").append(converterFactories.get(i).getClass().getName());
      }
      builder.append('\n');
    }
    builder.append("  Tried:");
    for (int i = start, count = converterFactories.size(); i < count; i++) {
      builder.append("\n   * ").append(converterFactories.get(i).getClass().getName());
    }
    throw new IllegalArgumentException(builder.toString());
  }
public <T> Converter<T, RequestBody> nextRequestBodyConverter(
      @Nullable Converter.Factory skipPast, Type type, Annotation[] parameterAnnotations,
      Annotation[] methodAnnotations) {
    checkNotNull(type, "type == null");
    checkNotNull(parameterAnnotations, "parameterAnnotations == null");
    checkNotNull(methodAnnotations, "methodAnnotations == null");

    int start = converterFactories.indexOf(skipPast) + 1;
    for (int i = start, count = converterFactories.size(); i < count; i++) {
      Converter.Factory factory = converterFactories.get(i);
      Converter<?, RequestBody> converter =
          factory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, this);
      if (converter != null) {
        //noinspection unchecked
        return (Converter<T, RequestBody>) converter;
      }
    }

    StringBuilder builder = new StringBuilder("Could not locate RequestBody converter for ")
        .append(type)
        .append(".\n");
    if (skipPast != null) {
      builder.append("  Skipped:");
      for (int i = 0; i < start; i++) {
        builder.append("\n   * ").append(converterFactories.get(i).getClass().getName());
      }
      builder.append('\n');
    }
    builder.append("  Tried:");
    for (int i = start, count = converterFactories.size(); i < count; i++) {
      builder.append("\n   * ").append(converterFactories.get(i).getClass().getName());
    }
    throw new IllegalArgumentException(builder.toString());
  }
public < T > Converter < T , RequestBody > nextRequestBodyConverter ( @ Nullable Converter . Factory skipPast , Type type , Annotation [ ] parameterAnnotations , Annotation [ ] methodAnnotations ) { checkNotNull ( type , "type == null" ) ; checkNotNull ( parameterAnnotations , "parameterAnnotations == null" ) ; checkNotNull ( methodAnnotations , "methodAnnotations == null" ) ; int start = converterFactories . indexOf ( skipPast ) + 1 ; for ( int i = start , count = converterFactories . size ( ) ; i < count ; i ++ ) { Converter . Factory factory = converterFactories . get ( i ) ; Converter < ? , RequestBody > converter = factory . requestBodyConverter ( type , parameterAnnotations , methodAnnotations , this ) ; if ( converter != null ) { //noinspection unchecked return ( Converter < T , RequestBody > ) converter ; } } StringBuilder builder = new StringBuilder ( "Could not locate RequestBody converter for " ) . append ( type ) . append ( ".\n" ) ; if ( skipPast != null ) { builder . append ( "  Skipped:" ) ; for ( int i = 0 ; i < start ; i ++ ) { builder . append ( "\n   * " ) . append ( converterFactories . get ( i ) . getClass ( ) . getName ( ) ) ; } builder . append ( ' ' ) ; } builder . append ( "  Tried:" ) ; for ( int i = start , count = converterFactories . size ( ) ; i < count ; i ++ ) { builder . append ( "\n   * " ) . append ( converterFactories . get ( i ) . getClass ( ) . getName ( ) ) ; } throw new IllegalArgumentException ( builder . toString ( ) ) ; }
Returns a {@link Converter} for {@code type} to {@link RequestBody} from the available
{@linkplain #converterFactories() factories} except {@code skipPast}.

@throws IllegalArgumentException if no converter available for {@code type}.
Returns a { @link Converter } for { @code type } to { @link RequestBody } from the available { @linkplain #converterFactories () factories } except { @code skipPast } .