Interface HttpUtil.Result<T>

Type Parameters:
T - type
All Known Implementing Classes:
HttpUtil.Result.Failure, HttpUtil.Result.Success
Enclosing class:
HttpUtil

public static sealed interface HttpUtil.Result<T> permits HttpUtil.Result.Success<T>, HttpUtil.Result.Failure<T>
http result
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Failure
    static final record 
    Success
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    orElse(@NotNull Function<Exception,T> function)
    Gets the value or handle exception
  • Method Details

    • orElse

      @NotNull default T orElse(@NotNull @NotNull Function<Exception,T> function)
      Gets the value or handle exception
      Parameters:
      function - exception handler
      Returns:
      value