io.github.fsixteen.data.jpa.base.generator.plugins.utils.ArrayUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of data-jpa-base-generator-interpreter Show documentation
Show all versions of data-jpa-base-generator-interpreter Show documentation
基于类快速生成Jpa Specification的框架工具中的注解解释器内容.
The newest version!
package io.github.fsixteen.data.jpa.base.generator.plugins.utils;
/**
* 数组工具.
*
* @author FSixteen
* @since 1.0.0
*/
public class ArrayUtils {
/**
* 判断给定数据是否存在于给定数据数组中.
*
* @param 数据泛型类
* @param eles 数据数组
* @param ele 数据
* @return boolean
*/
public static final boolean contains(final T[] eles, final T ele) {
if (null == eles || 0 == eles.length) {
return false;
} else {
if (null == ele) {
for (T e : eles) {
if (null == e) {
return true;
}
}
} else if (eles.getClass().getComponentType().isInstance(ele)) {
for (T e : eles) {
if (e.equals(ele)) {
return true;
}
}
}
}
return false;
}
}