How to do method chaining in Java? o.m1().m2().m3().m4()

后端 未结 6 852
渐次进展
渐次进展 2020-11-29 02:33

I\'ve seen in many Java code notation that after a method we call another, here is an example.

Toast.makeText(text).setGravity(Gravity.TOP, 0, 0).setView(lay         


        
6条回答
  •  天涯浪人
    2020-11-29 03:07

    or you can use Diezel that generates all the interfaces you need based on a Regular expression of your fluent API.

提交回复
热议问题