public class StreamExtension extends Object
| 构造器和说明 |
|---|
StreamExtension() |
@Comment(value="\u5c06\u5bf9\u8c61\u8f6c\u4e3aList") public static List<Object> arrayLikeToList(Object arrayLike)
@Comment(value="\u5c06\u96c6\u5408\u4f7f\u7528\u8fde\u63a5\u7b26\u62fc\u63a5\u8d77\u6765") public static String join(Object target, @Comment(name="separator",value="\u62fc\u63a5\u7b26\uff0c\u5982`,`") String separator)
@Comment(value="\u5c06\u96c6\u5408\u8f6c\u4e3aJavaBean") public static Object asBean(Object source, @Comment(name="target",value="\u76ee\u6807\u7c7b\u578b") Class<?> target)
@Comment(value="\u5c06\u96c6\u5408\u8f6c\u4e3aJavaBean") public static Object asBean(Object source, @Comment(name="target",value="\u76ee\u6807\u7c7b\u578b") Class<?> target, @Comment(name="isArray",value="\u662f\u5426\u662f\u6570\u7ec4") boolean isArray)
@Comment(value="\u5411\u96c6\u5408\u4e2d\u6dfb\u52a0\u5143\u7d20", origin=true) public Object push(Object target, @Comment(name="item",value="\u8981\u6dfb\u52a0\u7684\u5143\u7d20") Object item)
@Comment(value="\u5c06\u96c6\u5408\u8fdb\u884c\u8f6c\u6362\uff0c\u5e76\u8fd4\u56de\u65b0\u96c6\u5408", origin=true) public Object map(Object target, @Comment(name="function",value="\u8f6c\u6362\u51fd\u6570\uff0c\u5982\u63d0\u53d6\u5c5e\u6027`(item)=>item.xxx`") Function<Object[],Object> function)
function - 回调函数@Comment(value="\u5c06\u96c6\u5408\u8fdb\u884c\u8fc7\u6ee4\uff0c\u5e76\u8fd4\u56de\u65b0\u96c6\u5408", origin=true) public Object filter(Object target, @Comment(name="function",value="\u8fc7\u6ee4\u6761\u4ef6\uff0c\u5982`(item)=>item.xxx == 1`") Function<Object[],Object> function)
function - 回调函数@Comment(value="\u67e5\u627e\u5143\u7d20") public Object find(Object target, @Comment(name="function",value="\u5339\u914d\u6761\u4ef6\uff0c\u5982`(item)=>item.xxx == 1`") Function<Object[],Object> function)
@Comment(value="\u67e5\u627e\u5143\u7d20\u7d22\u5f15") public int findIndex(Object target, @Comment(name="function",value="\u5339\u914d\u6761\u4ef6\uff0c\u5982`(item)=>item.xxx == 1`") Function<Object[],Object> function)
@Comment(value="\u5408\u5e76\u591a\u4e2a\u96c6\u5408, \u8fd4\u56de\u65b0\u7684\u96c6\u5408", origin=true) public Object concat(Object src, @Comment(name="target",value="\u96c6\u5408") Object... target)
@Comment(value="\u96c6\u5408\u8f6c\u4e3aMap") public Map<Object,Object> toMap(Object src, @Comment(name="mappingKey",value="key\u503c") Function<Object[],Object> mappingKey, @Comment(name="mappingValue",value="value\u503c") Function<Object[],Object> mappingValue)
@Comment(value="\u96c6\u5408\u8f6c\u4e3aMap") public Map<Object,Object> toMap(Object src, @Comment(name="mappingKey",value="key\u503c") Function<Object[],Object> mappingKey)
@Comment(value="\u5c06\u96c6\u5408\u8fdb\u884c\u5faa\u73af\u64cd\u4f5c\uff0c\u5e76\u8fd4\u56de\u65b0\u96c6\u5408", origin=true) public Object each(Object target, @Comment(name="function",value="\u5faa\u73af\u51fd\u6570\uff0c\u5982\u5faa\u73af\u6dfb\u52a0\u5c5e\u6027`(item)=>{item.xxx = \'newVal\'}`") Function<Object[],Object> function)
function - 回调函数@Comment(value="\u5c06\u96c6\u5408\u8fdb\u884c\u6392\u5e8f\uff0c\u5e76\u8fd4\u56de\u65b0\u96c6\u5408", origin=true) public Object sort(Object target, @Comment(name="function",value="\u6392\u5e8f\u51fd\u6570\uff0c\u5982\u4ece\u5927\u5230\u5c0f`(a,b)=>a-b`") Function<Object[],Object> function)
@Comment(value="\u5c06\u96c6\u5408\u8fdb\u884c\u53cd\u8f6c\u64cd\u4f5c", origin=true) public Object reserve(Object target)
@Comment(value="\u5c06\u96c6\u5408\u7684\u987a\u5e8f\u6253\u4e71", origin=true) public Object shuffle(Object target)
@Comment(value="\u96c6\u5408\u53bb\u91cd", origin=true) public Object distinct(Object target)
@Comment(value="\u96c6\u5408\u53bb\u91cd", origin=true) public Object distinct(Object target, @Comment(name="condition",value="\u53bb\u91cd\u8f6c\u6362\u5668\uff0c\u5982\u6839\u636eid\u53bb\u91cd `item=>item.id`") Function<Object[],Object> condition)
@Comment(value="\u5c06\u96c6\u5408\u4f7f\u7528`,`\u62fc\u63a5\u8d77\u6765") public String join(Object target)
@Comment(value="\u53d6\u51fa\u96c6\u5408\u6700\u5927\u503c\uff0c\u5982\u679c\u627e\u4e0d\u5230\u8fd4\u56de`null`") public Object max(Object target)
@Comment(value="\u53d6\u51fa\u96c6\u5408\u6700\u5c0f\u503c\uff0c\u5982\u679c\u627e\u4e0d\u5230\u8fd4\u56de`null`") public Object min(Object target)
@Comment(value="\u53d6\u51fa\u96c6\u5408\u5e73\u5747\u503c\uff0c\u5982\u679c\u65e0\u6cd5\u8ba1\u7b97\u8fd4\u56de`null`") public Double avg(Object target)
@Comment(value="\u5bf9\u96c6\u5408\u8fdb\u884c\u7d2f\u52a0\u64cd\u4f5c") public Number sum(Object target)
@Comment(value="\u5bf9\u96c6\u5408\u8fdb\u884c\u5206\u7ec4") public Map<Object,List<Object>> group(Object target, @Comment(name="condition",value="\u5206\u7ec4\u6761\u4ef6\uff0c\u5982`item=>item.xxx + \'_\' + item.yyy`") Function<Object[],Object> condition)
condition - 分组条件@Comment(value="\u5bf9\u96c6\u5408\u8fdb\u884c\u5206\u7ec4\u5e76\u8f6c\u6362") public Map<Object,Object> group(Object target, @Comment(name="condition",value="\u5206\u7ec4\u6761\u4ef6\uff0c\u5982`item=>item.xxx + \'_\' + item.yyy`") Function<Object[],Object> condition, @Comment(name="mapping",value="\u8f6c\u6362\u51fd\u6570\uff0c\u5982\u5206\u7ec4\u6c42\u548c`(list)=>list.sum()`") Function<Object[],Object> mapping)
condition - 分组条件mapping - 结果映射@Comment(value="\u5c06\u4e24\u4e2a\u96c6\u5408\u5173\u8054\u8d77\u6765") public List<Object> join(Object source, @Comment(name="target",value="\u53e6\u4e00\u4e2a\u96c6\u5408") Object target, @Comment(name="condition",value="\u5173\u8054\u6761\u4ef6\uff0c\u5982:`(left,right)=>left.xxx = right.xxx`") Function<Object[],Object> condition)
source - 左表target - 右表condition - 条件@Comment(value="\u5c06\u4e24\u4e2a\u96c6\u5408\u5173\u8054\u5e76\u8f6c\u6362") public List<Object> join(Object source, @Comment(name="target",value="\u53e6\u4e00\u4e2a\u96c6\u5408") Object target, @Comment(name="condition",value="\u5173\u8054\u6761\u4ef6\uff0c\u5982:`(left,right)=>left.xxx == right.xxx`") Function<Object[],Object> condition, @Comment(name="mapping",value="\u6620\u5c04\u51fd\u6570\uff0c\u5982:`(left,right)=>{xxx : left.xxx, yyy : right.yyy}`") Function<Object[],Object> mapping)
source - 左表target - 右表condition - 条件mapping - 映射@Comment(value="\u622a\u53d6\u96c6\u5408", origin=true) public Object skip(Object source, @Comment(name="value",value="\u8df3\u8fc7\u7684\u6570\u91cf") int value)
@Comment(value="\u9650\u5236\u96c6\u5408\u6570\u91cf", origin=true) public Object limit(Object source, @Comment(name="value",value="\u8df3\u8fc7\u7684\u6570\u91cf") int value)
@Comment(value="\u5224\u65ad\u96c6\u5408\u662f\u5426\u90fd\u6ee1\u8db3\u6761\u4ef6") public boolean every(Object source, @Comment(name="condition",value="\u5224\u65ad\u6761\u4ef6") Function<Object[],Object> condition)
@Comment(value="\u5224\u65ad\u96c6\u5408\u4e2d\u662f\u5426\u81f3\u5c11\u6709\u4e00\u4e2a\u5143\u7d20\u6ee1\u8db3\u6761\u4ef6") public boolean some(Object source, @Comment(name="condition",value="\u5224\u65ad\u6761\u4ef6") Function<Object[],Object> condition)
@Comment(value="\u627e\u5230\u96c6\u5408\u4e2d\u7b2c\u4e00\u4e2a\u4e0d\u4e3anull\u7684\u5143\u7d20") public Object findNotNull(Object source)
@Comment(value="\u5faa\u73af\u96c6\u5408\u901a\u8fc7\u7ed9\u5b9a\u7684\u8ba1\u7b97\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u65b0\u503c") public Object reduce(Object source, @Comment(name="reduceFunction",value="\u5904\u7406\u51fd\u6570\uff0c\u5982\u7d2f\u52a0\u8ba1\u7b97\uff1a`(val,item)=>val + item`") Function<Object[],Object> reduceFunction)
@Comment(value="\u8fd4\u56de\u96c6\u5408\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20") public static Object first(Object source)
@Comment(value="\u8fd4\u56de\u96c6\u5408\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20") public Object last(Object source)
@Comment(value="\u8fd4\u56de\u96c6\u5408\u6216\u6570\u7ec4\u7684\u957f\u5ea6") public int size(Object arrayLike)
Copyright © 2020–2022. All rights reserved.