![JAR search and dependency download from the Maven repository](/logo.png)
cn.tenmg.dsl.utils.SetUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dsl Show documentation
Show all versions of dsl Show documentation
动态脚本语言(DSL,Dynamic Script Language)解析框架。可广泛用于动态 SQL(即
DSQL)等场景的解析,DSQL 也是目前 DSL 最成功的应用领域,具体包括 Flink SQL(如 Clink)、Spark SQL(如
sparktool)和 JDBC(如 sqltool)。
The newest version!
package cn.tenmg.dsl.utils;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
/**
* 集合工具类
*
* @author June [email protected]
*
* @since 1.2.10
*/
public abstract class SetUtils {
/**
* 将元素组装成一个哈希集合对象
*
* @param elements
* 元素
* @return 哈希集合对象
*/
@SafeVarargs
public static HashSet newHashSet(final E... elements) {
final HashSet set = new HashSet<>(elements.length);
Collections.addAll(set, elements);
return set;
}
/**
* 将元素组装成一个有序哈希集合对象
*
* @param elements
* 元素
* @return 有序哈希集合对象
*/
@SafeVarargs
public static LinkedHashSet newLinkedHashSet(final E... elements) {
final LinkedHashSet set = new LinkedHashSet<>(elements.length);
Collections.addAll(set, elements);
return set;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy