javastream过滤时间,java8stream部分应⽤
1.list转list
List> tables = uteSql(connection, sql);
List = tables.parallelStream().map(table -> DataSourceUtils.fetchStringColumnValue(table, columnName)) .List());
List metaDataBaseSyncList = aDataBaseSyncMapper
.selectList(metaDataBaseSyncEntityWrapper);
List metaDataBaseSyncIds = metaDataBaseSyncList.parallelStream().map(MetaDataBaseSyncT::getId)
.List());
2.list转map
List metaDataFieldList = aDataFieldMapper.selectList(metaDataFieldEntityWrapper);
java streamMap> metaFieldMap = metaDataFieldList.parallelStream()
.upingBy(MetaDataFieldT::getMetaDataId));
Map metaDataFieldSyncMap = metaDataFieldSyncList.stream()
.Map(MetaDataFieldSyncT::getFieldName, data -> data));
3.list过滤
Optional metaSyncBase = metaDataBaseSyncList.stream()
.filter(data -> StringUtils.Name(), Name()))
.findFirst();
4.list中任⼀匹配
tableResult.stream()
.anyMatch(data -> !StringUtils.Status(), NumberUtils.String()))
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论