下面列出了io.reactivex.rxjava3.core.Observable#just ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@GET
@Produces("application/json")
@Path("textJsonList")
public Observable<List<HelloWorldBean>> getJsonList() {
HelloWorldBean bean1 = new HelloWorldBean();
HelloWorldBean bean2 = new HelloWorldBean();
bean2.setGreeting("Ciao");
return Observable.just(Arrays.asList(bean1, bean2));
}
@GET
@Produces("text/plain")
@Path("text")
public Observable<String> getText() {
return Observable.just("Hello, world!");
}
@GET
@Produces("application/json")
@Path("textJson")
public Observable<HelloWorldBean> getJson() {
return Observable.just(new HelloWorldBean());
}