摘要: 在使用GUAVA的集合transform时,经常需要碰到去null,异常的元素,怎么处理?使用Optional! 1 Iterable iterable = Optional.presentInstances(Lists.transform(serviceInstances, new Function>() { 2 @Nullable 3 @Override 4 public Optional apply(@Nullable ServiceInstance input) { 5 if (remove) { 6 return Opt... 阅读全文
posted @ 2014-03-03 11:33 小玄子的后花园 阅读(403) 评论(0) 推荐(0)