Annotation Interface ResponseCodeMapper


@Retention(RUNTIME) @Target(METHOD) @Repeatable(ResponseCodeMappers.class) public @interface ResponseCodeMapper
Русский: Аннотация позволяет указывать обработчики HTTP ответов на определенные HTTP статус коды
English: Annotation allows you to specify HTTP response handlers for specific HTTP status codes

Пример / Example:
 
 @HttpClient("my.config")
 public interface MyHttpclient {

     @ResponseCodeMapper(code = DEFAULT, mapper = MyOtherMapper.class)
     @ResponseCodeMapper(code = 200, mapper = MyMapper.class)
     @HttpRoute(method = HttpMethod.POST, path = "/users/status")
     void postStatus();
 }
 
 
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
     
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Русский: Указывает что обработчик будет действовать для любого HTTP статус кода за исключением других указанных ResponseCodeMapper English: Specifies that the handler will act on any HTTP status code except for other specified ResponseCodeMapper
  • Field Details

    • DEFAULT

      static final int DEFAULT
      Русский: Указывает что обработчик будет действовать для любого HTTP статус кода за исключением других указанных ResponseCodeMapper
      English: Specifies that the handler will act on any HTTP status code except for other specified ResponseCodeMapper
      See Also:
  • Element Details

    • code

      int code
      Returns:
      Русский: Указывает для какого HTTP статус кода зарегистрировать обработчик
      English: Specifies for which HTTP status code to register the handler
    • type

      Class<?> type
      Default:
      java.lang.Object.class
    • mapper

      Class<? extends HttpClientResponseMapper> mapper
      Returns:
      Русский: Указывает реализацию обработчика который требуется зарегистрировать
      English: Specifies the implementation of the handler to be registered
      Default:
      ru.tinkoff.kora.http.client.common.response.HttpClientResponseMapper.class