Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public final class MyModelAdapter {
- private OnConnectionReady onConnectionReady;
- public MyModelAdapter setOnConnectionReady(OnConnectionReady connection) {
- this.onConnectionReady = connection;
- return this;
- }
- public interface OnConnectionReady {
- void onConnect(String message);
- }
- //more stuff..
- }
- public final class MyModel {
- private MyModelAdapter adapter;
- public void do() {
- adapter.setOnConnectionReady(this::whenAdapterIsConnected);
- }
- public void whenAdapterIsConnected(String message) {
- //make fun
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement