@Test public void error() { Throwable error = new IOException(); Result<Object> result = Result.error(error); assertThat(result.isError()).isTrue(); assertThat(result.error()).isSameAs(error); assertThat(result.response()).isNull(); }
public static <T> Result<T> error(Throwable error) { if (error == null) { throw new NullPointerException("mError == null"); } return new Result<>(null, error); }
Result { public static <T> Result<T> error(Throwable error) { if (error == null) { throw new NullPointerException("mError == null"); } return new Result<>(null, error); } }
Result { public static <T> Result<T> error(Throwable error) { if (error == null) { throw new NullPointerException("mError == null"); } return new Result<>(null, error); } private  Result(Response<T> response, Throwable error); }
Result { public static <T> Result<T> error(Throwable error) { if (error == null) { throw new NullPointerException("mError == null"); } return new Result<>(null, error); } private  Result(Response<T> response, Throwable error); static Result<T> error(Throwable error); static Result<T> response(Response<T> response); Response<T> response(); Throwable error(); boolean isError(); }
Result { public static <T> Result<T> error(Throwable error) { if (error == null) { throw new NullPointerException("mError == null"); } return new Result<>(null, error); } private  Result(Response<T> response, Throwable error); static Result<T> error(Throwable error); static Result<T> response(Response<T> response); Response<T> response(); Throwable error(); boolean isError();  }