@Test public void response() { Response<String> response = Response.success("Hi"); Result<String> result = Result.response(response); assertThat(result.isError()).isFalse(); assertThat(result.error()).isNull(); assertThat(result.response()).isSameAs(response); }
public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); }
Result { public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } }
Result { public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } private  Result(Response<T> response, Throwable error); }
Result { public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } 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> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } 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();  }