写了段代码,然后我把自己打了一顿

Jwxl 发布于 2016/08/25 19:44
阅读 589
收藏 0

如题这都是什么玩意?



@Test
	public void groupBy() {
		Observable.just("Ben", "Michael", "Mark").groupBy((key) -> key.substring(0, 1)).subscribe((grouped) -> grouped.toList().subscribe((list) -> System.out.println("First character: " + grouped.getKey() + ", elements: " + list)));
	}
其实原来它是这样的

@Test
	public void groupBy() {
		Observable.just("Ben", "Michael", "Mark").
			groupBy((key) -> key.substring(0, 1)).
			subscribe(
					(grouped) -> grouped.toList().
					subscribe(
							(list) -> System.out.println("First character: " + grouped.getKey() + ", elements: " + list)
					)
			);
	}



但是我习惯动不动就ctrl+shift+F ,然后就变成上面那样了.有什么办法在eclipse 格式化lambda的方法吗?

加载中
0
游客
游客
你要重新定义你的formatter
0
A
Ajsgn
publicvoidgroupBy() { //
        Observable.just("Ben","Michael","Mark"). //
            groupBy((key) -> key.substring(0,1)). //
            subscribe( //
                    (grouped) -> grouped.toList(). //
                    subscribe( //
                            (list) -> System.out.println("First character: "+ grouped.getKey() +", elements: "+ list) //
                    ) //
            ); //
    } //
0
紫云互联
紫云互联
让你不学好,学人家用格式化!
返回顶部
顶部