Class UtilsKt

  • All Implemented Interfaces:

    
    public final class UtilsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Boolean hasRequestSucceeded(NetworkResponse $self) Checks if the network response indicates a successful request.
      final static Boolean hasRequestSucceeded(Response $self)
      final static Boolean isSuccessfulResponse(Response $self) Checks if the OkHttp response indicates a successful request.
      final static BufferedSource fromFile(String filePath) Reads the response body as a BufferedSource from the given Response.
      final static Unit safeClose(Source $self) Reads the response body as a BufferedSource from the given Response.
      final static Unit sleep(Long timeInMillis) Sleeps for the specified time in milliseconds, handling interruptions gracefully.
      final static Response executeAsync(Call $self)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • isSuccessfulResponse

         final static Boolean isSuccessfulResponse(Response $self)

        Checks if the OkHttp response indicates a successful request.

      • fromFile

         final static BufferedSource fromFile(String filePath)

        Reads the response body as a BufferedSource from the given Response.

      • safeClose

         final static Unit safeClose(Source $self)

        Reads the response body as a BufferedSource from the given Response.

      • sleep

         final static Unit sleep(Long timeInMillis)

        Sleeps for the specified time in milliseconds, handling interruptions gracefully.

        Parameters:
        timeInMillis - The time to sleep in milliseconds.
      • executeAsync

         final static Response executeAsync(Call $self)