Record Class HttpClientResponse.Default

java.lang.Object
java.lang.Record
ru.tinkoff.kora.http.client.common.response.HttpClientResponse.Default
All Implemented Interfaces:
Closeable, AutoCloseable, HttpClientResponse
Enclosing interface:
HttpClientResponse

public static record HttpClientResponse.Default(int code, ru.tinkoff.kora.http.common.header.HttpHeaders headers, ru.tinkoff.kora.http.common.body.HttpBodyInput body, Runnable closer) extends Record implements HttpClientResponse
  • Nested Class Summary

    Nested classes/interfaces inherited from interface ru.tinkoff.kora.http.client.common.response.HttpClientResponse

    HttpClientResponse.Default
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default(int code, ru.tinkoff.kora.http.common.header.HttpHeaders headers, ru.tinkoff.kora.http.common.body.HttpBodyInput body, Runnable closer)
    Creates an instance of a Default record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    ru.tinkoff.kora.http.common.body.HttpBodyInput
    Returns the value of the body record component.
    void
     
    Returns the value of the closer record component.
    int
    Returns the value of the code record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    ru.tinkoff.kora.http.common.header.HttpHeaders
    Returns the value of the headers record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Default

      public Default(int code, ru.tinkoff.kora.http.common.header.HttpHeaders headers, ru.tinkoff.kora.http.common.body.HttpBodyInput body, Runnable closer)
      Creates an instance of a Default record class.
      Parameters:
      code - the value for the code record component
      headers - the value for the headers record component
      body - the value for the body record component
      closer - the value for the closer record component
  • Method Details

    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface HttpClientResponse
      Throws:
      IOException
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • code

      public int code()
      Returns the value of the code record component.
      Specified by:
      code in interface HttpClientResponse
      Returns:
      the value of the code record component
    • headers

      public ru.tinkoff.kora.http.common.header.HttpHeaders headers()
      Returns the value of the headers record component.
      Specified by:
      headers in interface HttpClientResponse
      Returns:
      the value of the headers record component
    • body

      public ru.tinkoff.kora.http.common.body.HttpBodyInput body()
      Returns the value of the body record component.
      Specified by:
      body in interface HttpClientResponse
      Returns:
      the value of the body record component
    • closer

      public Runnable closer()
      Returns the value of the closer record component.
      Returns:
      the value of the closer record component