最近,公司同事要求我给他们讲一下RxJava,为了更清晰的说明其架构,.
简单写了一个链式调用的小Demo,分享给大家
/*
*作者:赵星海 (CSDN-深海呐)
*时间:2019年3月19日16:56:32
*用途:链式调用Demo
*/
public class Test_RxJava_Chained {
private static Test_RxJava_Chained little_black = new Test_RxJava_Chained();
private String name;
private int height;
private Test_RxJava_Chained() {// 构造私有化 只能通过get获取对象
}
public static Test_RxJava_Chained getLittle() {
return little_black;
}
public Test_RxJava_Chained setName(String name) {
this.name = name;
return little_black;
}
public Test_RxJava_Chained setHeight(int height) {
this.height = height;
return little_black;
}
public Test_RxJava_Chained buid() {
little_black.name = this.name;
little_black.height = this.height;
return little_black;
}
public void Test() {
Test_RxJava_Chained obj = Test_RxJava_Chained
.getLittle()
.setName("深海呐")
.setHeight(184)
.buid();
}
}
标签:little,Java,Chained,Demo,height,RxJava,black,链式,Test From: https://blog.51cto.com/u_13520184/6115598