mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
[cleanup] erefactor/EclipseJdt - Remove trailing whitespace - All lines
EclipseJdt cleanup 'RemoveAllTrailingWhitespace' applied by erefactor. For EclipseJdt see https://www.eclipse.org/eclipse/news/4.18/jdt.php For erefactor see https://github.com/cal101/erefactor
This commit is contained in:
parent
b285db71cd
commit
e41c676ed5
@ -6,7 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
/**
|
||||
* 随机字符验证码生成器<br>
|
||||
* 可以通过传入的基础集合和长度随机生成验证码字符
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
* @since 4.1.2
|
||||
*/
|
||||
@ -15,7 +15,7 @@ public class RandomGenerator extends AbstractGenerator {
|
||||
|
||||
/**
|
||||
* 构造,使用字母+数字做为基础
|
||||
*
|
||||
*
|
||||
* @param count 生成验证码长度
|
||||
*/
|
||||
public RandomGenerator(int count) {
|
||||
@ -24,7 +24,7 @@ public class RandomGenerator extends AbstractGenerator {
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param baseStr 基础字符集合,用于随机获取字符串的字符集合
|
||||
* @param length 生成验证码长度
|
||||
*/
|
||||
@ -36,7 +36,7 @@ public class RandomGenerator extends AbstractGenerator {
|
||||
public String generate() {
|
||||
return RandomUtil.randomString(this.baseStr, this.length);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean verify(String code, String userInputCode) {
|
||||
if (StrUtil.isNotBlank(userInputCode)) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 验证码生成策略实现
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
* @since 4.1.2
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 图片验证码实现
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@ import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CaptchaUtilTest {
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void createTest() {
|
||||
|
@ -43,7 +43,7 @@ public class CombinationAnnotationElement implements AnnotatedElement, Serializa
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param element 需要解析注解的元素:可以是Class、Method、Field、Constructor、ReflectPermission
|
||||
*/
|
||||
public CombinationAnnotationElement(AnnotatedElement element) {
|
||||
@ -73,17 +73,17 @@ public class CombinationAnnotationElement implements AnnotatedElement, Serializa
|
||||
final Collection<Annotation> annotations = this.declaredAnnotationMap.values();
|
||||
return annotations.toArray(new Annotation[0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
*
|
||||
* @param element 元素
|
||||
*/
|
||||
private void init(AnnotatedElement element) {
|
||||
final Annotation[] declaredAnnotations = element.getDeclaredAnnotations();
|
||||
this.declaredAnnotationMap = new HashMap<>();
|
||||
parseDeclared(declaredAnnotations);
|
||||
|
||||
|
||||
final Annotation[] annotations = element.getAnnotations();
|
||||
if(Arrays.equals(declaredAnnotations, annotations)) {
|
||||
this.annotationMap = this.declaredAnnotationMap;
|
||||
@ -109,7 +109,7 @@ public class CombinationAnnotationElement implements AnnotatedElement, Serializa
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 进行递归解析注解,直到全部都是元注解为止
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 注解包,提供增强型注解和注解工具类
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
|
@ -11,9 +11,9 @@ import cn.hutool.core.lang.func.Func0;
|
||||
*/
|
||||
public enum BeanDescCache {
|
||||
INSTANCE;
|
||||
|
||||
|
||||
private final SimpleCache<Class<?>, BeanDesc> bdCache = new SimpleCache<>();
|
||||
|
||||
|
||||
/**
|
||||
* 获得属性名和{@link BeanDesc}Map映射
|
||||
* @param beanClass Bean的类
|
||||
|
@ -13,19 +13,19 @@ public class BeanException extends RuntimeException{
|
||||
public BeanException(Throwable e) {
|
||||
super(ExceptionUtil.getMessage(e), e);
|
||||
}
|
||||
|
||||
|
||||
public BeanException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
public BeanException(String messageTemplate, Object... params) {
|
||||
super(StrUtil.format(messageTemplate, params));
|
||||
}
|
||||
|
||||
|
||||
public BeanException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
}
|
||||
|
||||
|
||||
public BeanException(Throwable throwable, String messageTemplate, Object... params) {
|
||||
super(StrUtil.format(messageTemplate, params), throwable);
|
||||
}
|
||||
|
@ -23,9 +23,9 @@ import java.util.Map;
|
||||
* <li>.表达式,可以获取Bean对象中的属性(字段)值或者Map中key对应的值</li>
|
||||
* <li>[]表达式,可以获取集合等对象中对应index的值</li>
|
||||
* </ol>
|
||||
*
|
||||
*
|
||||
* 表达式栗子:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* persion
|
||||
* persion.name
|
||||
@ -33,7 +33,7 @@ import java.util.Map;
|
||||
* person.friends[5].name
|
||||
* ['person']['friends'][5]['name']
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author Looly
|
||||
* @since 4.0.6
|
||||
*/
|
||||
@ -54,9 +54,9 @@ public class BeanPath implements Serializable{
|
||||
* <li>.表达式,可以获取Bean对象中的属性(字段)值或者Map中key对应的值</li>
|
||||
* <li>[]表达式,可以获取集合等对象中对应index的值</li>
|
||||
* </ol>
|
||||
*
|
||||
*
|
||||
* 表达式栗子:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* persion
|
||||
* persion.name
|
||||
@ -64,7 +64,7 @@ public class BeanPath implements Serializable{
|
||||
* person.friends[5].name
|
||||
* ['person']['friends'][5]['name']
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @param expression 表达式
|
||||
* @return BeanPath
|
||||
*/
|
||||
@ -74,7 +74,7 @@ public class BeanPath implements Serializable{
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param expression 表达式
|
||||
*/
|
||||
public BeanPath(String expression) {
|
||||
@ -83,7 +83,7 @@ public class BeanPath implements Serializable{
|
||||
|
||||
/**
|
||||
* 获取Bean中对应表达式的值
|
||||
*
|
||||
*
|
||||
* @param bean Bean对象或Map或List等
|
||||
* @return 值,如果对应值不存在,则返回null
|
||||
*/
|
||||
@ -95,29 +95,29 @@ public class BeanPath implements Serializable{
|
||||
* 设置表达式指定位置(或filed对应)的值<br>
|
||||
* 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值<br>
|
||||
* 注意:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
|
||||
* 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @param bean Bean、Map或List
|
||||
* @param value 值
|
||||
*/
|
||||
public void set(Object bean, Object value) {
|
||||
set(bean, this.patternParts, value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置表达式指定位置(或filed对应)的值<br>
|
||||
* 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值<br>
|
||||
* 注意:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
|
||||
* 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @param bean Bean、Map或List
|
||||
* @param patternParts 表达式块列表
|
||||
* @param value 值
|
||||
@ -135,7 +135,7 @@ public class BeanPath implements Serializable{
|
||||
// ------------------------------------------------------------------------------------------------------------------------------------- Private method start
|
||||
/**
|
||||
* 获取Bean中对应表达式的值
|
||||
*
|
||||
*
|
||||
* @param patternParts 表达式分段列表
|
||||
* @param bean Bean对象或Map或List等
|
||||
* @param ignoreLast 是否忽略最后一个值,忽略最后一个值则用于set,否则用于read
|
||||
@ -215,7 +215,7 @@ public class BeanPath implements Serializable{
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
*
|
||||
* @param expression 表达式
|
||||
*/
|
||||
private void init(String expression) {
|
||||
@ -277,7 +277,7 @@ public class BeanPath implements Serializable{
|
||||
|
||||
/**
|
||||
* 对于非表达式去除单引号
|
||||
*
|
||||
*
|
||||
* @param expression 表达式
|
||||
* @return 表达式
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ import java.util.Map;
|
||||
* 3. Map 转 Bean
|
||||
* 4. Map 转 Map
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
* @param <T> 目标对象类型
|
||||
@ -33,7 +33,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/** 源对象 */
|
||||
private final Object source;
|
||||
/** 目标对象 */
|
||||
@ -45,7 +45,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
|
||||
/**
|
||||
* 创建BeanCopier
|
||||
*
|
||||
*
|
||||
* @param <T> 目标Bean类型
|
||||
* @param source 来源对象,可以是Bean或者Map
|
||||
* @param dest 目标Bean对象
|
||||
@ -58,7 +58,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
|
||||
/**
|
||||
* 创建BeanCopier
|
||||
*
|
||||
*
|
||||
* @param <T> 目标Bean类型
|
||||
* @param source 来源对象,可以是Bean或者Map
|
||||
* @param dest 目标Bean对象
|
||||
@ -72,7 +72,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param source 来源对象,可以是Bean或者Map
|
||||
* @param dest 目标Bean对象
|
||||
* @param destType 目标的泛型类型,用于标注有泛型参数的Bean对象
|
||||
@ -115,7 +115,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
|
||||
/**
|
||||
* Bean和Bean之间属性拷贝
|
||||
*
|
||||
*
|
||||
* @param providerBean 来源Bean
|
||||
* @param destBean 目标Bean
|
||||
*/
|
||||
@ -125,7 +125,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
|
||||
/**
|
||||
* Map转Bean属性拷贝
|
||||
*
|
||||
*
|
||||
* @param map Map
|
||||
* @param bean Bean
|
||||
*/
|
||||
@ -138,7 +138,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
|
||||
/**
|
||||
* Map转Map
|
||||
*
|
||||
*
|
||||
* @param source 源Map
|
||||
* @param dest 目标Map
|
||||
*/
|
||||
@ -151,7 +151,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
|
||||
/**
|
||||
* 对象转Map
|
||||
*
|
||||
*
|
||||
* @param bean bean对象
|
||||
* @param targetMap 目标的Map
|
||||
* @since 4.1.22
|
||||
@ -201,7 +201,7 @@ public class BeanCopier<T> implements Copier<T>, Serializable {
|
||||
/**
|
||||
* 值提供器转Bean<br>
|
||||
* 此方法通过遍历目标Bean的字段,从ValueProvider查找对应值
|
||||
*
|
||||
*
|
||||
* @param valueProvider 值提供器
|
||||
* @param bean Bean
|
||||
*/
|
||||
|
@ -6,17 +6,17 @@ import java.lang.reflect.Type;
|
||||
* 值提供者,用于提供Bean注入时参数对应值得抽象接口<br>
|
||||
* 继承或匿名实例化此接口<br>
|
||||
* 在Bean注入过程中,Bean获得字段名,通过外部方式根据这个字段名查找相应的字段值,然后注入Bean<br>
|
||||
*
|
||||
*
|
||||
* @author Looly
|
||||
* @param <T> KEY类型,一般情况下为 {@link String}
|
||||
*
|
||||
*/
|
||||
public interface ValueProvider<T>{
|
||||
|
||||
|
||||
/**
|
||||
* 获取值<br>
|
||||
* 返回值一般需要匹配被注入类型,如果不匹配会调用默认转换 Convert#convert(Type, Object)实现转换
|
||||
*
|
||||
*
|
||||
* @param key Bean对象中参数名
|
||||
* @param valueType 被注入的值的类型
|
||||
* @return 对应参数名的值
|
||||
@ -26,7 +26,7 @@ public interface ValueProvider<T>{
|
||||
/**
|
||||
* 是否包含指定KEY,如果不包含则忽略注入<br>
|
||||
* 此接口方法单独需要实现的意义在于:有些值提供者(比如Map)key是存在的,但是value为null,此时如果需要注入这个null,需要根据此方法判断
|
||||
*
|
||||
*
|
||||
* @param key Bean对象中参数名
|
||||
* @return 是否包含指定KEY
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Bean拷贝实现,包括拷贝选项等
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Bean值提供者方式封装
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Bean相关操作,包括Bean信息描述,Bean路径表达式、动态Bean、Bean工具等
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 建造者模式接口定义
|
||||
*
|
||||
*
|
||||
* @param <T> 建造对象类型
|
||||
* @author Looly
|
||||
* @since 4.2.2
|
||||
@ -12,7 +12,7 @@ import java.io.Serializable;
|
||||
public interface Builder<T> extends Serializable{
|
||||
/**
|
||||
* 构建
|
||||
*
|
||||
*
|
||||
* @return 被构建的对象
|
||||
*/
|
||||
T build();
|
||||
|
@ -8,7 +8,7 @@ import java.lang.reflect.Modifier;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
/**
|
||||
* 用于构建 {@link java.lang.Comparable#compareTo(Object)} 方法的辅助工具
|
||||
*
|
||||
* <p>
|
||||
@ -33,7 +33,7 @@ import java.util.Comparator;
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* 字段值按照顺序比较,如果某个字段返回非0结果,比较终止,使用{@code toComparison()}返回结果,后续比较忽略。
|
||||
*
|
||||
* <p>
|
||||
@ -52,7 +52,7 @@ import java.util.Comparator;
|
||||
*/
|
||||
public class CompareToBuilder implements Builder<Integer> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/** 当前比较状态 */
|
||||
private int comparison;
|
||||
|
||||
@ -65,7 +65,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
/**
|
||||
* 通过反射比较两个Bean对象,对象字段可以为private。比较规则如下:
|
||||
*
|
||||
* <ul>
|
||||
@ -94,7 +94,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* <p>Compares two <code>Object</code>s via reflection.</p>
|
||||
*
|
||||
* <p>Fields can be private, thus <code>AccessibleObject.setAccessible</code>
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* security manager unless the appropriate permissions are set.</p>
|
||||
*
|
||||
* <ul>
|
||||
@ -126,7 +126,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* <p>Compares two <code>Object</code>s via reflection.</p>
|
||||
*
|
||||
* <p>Fields can be private, thus <code>AccessibleObject.setAccessible</code>
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* security manager unless the appropriate permissions are set.</p>
|
||||
*
|
||||
* <ul>
|
||||
@ -159,7 +159,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* <p>Compares two <code>Object</code>s via reflection.</p>
|
||||
*
|
||||
* <p>Fields can be private, thus <code>AccessibleObject.setAccessible</code>
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* security manager unless the appropriate permissions are set.</p>
|
||||
*
|
||||
* <ul>
|
||||
@ -192,7 +192,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* <p>Compares two <code>Object</code>s via reflection.</p>
|
||||
*
|
||||
* <p>Fields can be private, thus <code>AccessibleObject.setAccessible</code>
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* is used to bypass normal access control checks. This will fail under a
|
||||
* security manager unless the appropriate permissions are set.</p>
|
||||
*
|
||||
* <ul>
|
||||
@ -221,10 +221,10 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* @since 2.2 (2.0 as <code>reflectionCompare(Object, Object, boolean, Class)</code>)
|
||||
*/
|
||||
public static int reflectionCompare(
|
||||
final Object lhs,
|
||||
final Object rhs,
|
||||
final boolean compareTransients,
|
||||
final Class<?> reflectUpToClass,
|
||||
final Object lhs,
|
||||
final Object rhs,
|
||||
final boolean compareTransients,
|
||||
final Class<?> reflectUpToClass,
|
||||
final String... excludeFields) {
|
||||
|
||||
if (lhs == rhs) {
|
||||
@ -249,7 +249,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
/**
|
||||
* <p>Appends to <code>builder</code> the comparison of <code>lhs</code>
|
||||
* to <code>rhs</code> using the fields defined in <code>clazz</code>.</p>
|
||||
*
|
||||
*
|
||||
* @param lhs left-hand object
|
||||
* @param rhs right-hand object
|
||||
* @param clazz <code>Class</code> that defines fields to be compared
|
||||
@ -264,7 +264,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
final CompareToBuilder builder,
|
||||
final boolean useTransients,
|
||||
final String[] excludeFields) {
|
||||
|
||||
|
||||
final Field[] fields = clazz.getDeclaredFields();
|
||||
AccessibleObject.setAccessible(fields, true);
|
||||
for (int i = 0; i < fields.length && builder.comparison == 0; i++) {
|
||||
@ -300,7 +300,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
comparison = superCompareTo;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Appends to the <code>builder</code> the comparison of
|
||||
@ -312,7 +312,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* a <code>null</code> object is less than a non-<code>null</code> object</li>
|
||||
* <li>Check the object contents</li>
|
||||
* </ol>
|
||||
*
|
||||
*
|
||||
* <p><code>lhs</code> must either be an array or implement {@link Comparable}.</p>
|
||||
*
|
||||
* @param lhs left-hand object
|
||||
@ -441,7 +441,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
/**
|
||||
* Appends to the <code>builder</code> the comparison of
|
||||
* two <code>short</code>s.
|
||||
*
|
||||
*
|
||||
* @param lhs left-hand value
|
||||
* @param rhs right-hand value
|
||||
* @return this - used to chain append calls
|
||||
@ -473,7 +473,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
/**
|
||||
* Appends to the <code>builder</code> the comparison of
|
||||
* two <code>byte</code>s.
|
||||
*
|
||||
*
|
||||
* @param lhs left-hand value
|
||||
* @param rhs right-hand value
|
||||
* @return this - used to chain append calls
|
||||
@ -575,7 +575,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
public CompareToBuilder append(final Object[] lhs, final Object[] rhs) {
|
||||
return append(lhs, rhs, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>Appends to the <code>builder</code> the deep comparison of
|
||||
* two <code>Object</code> arrays.</p>
|
||||
@ -950,7 +950,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* the <code>builder</code> has judged the "left-hand" side
|
||||
* as less than, greater than, or equal to the "right-hand"
|
||||
* side.
|
||||
*
|
||||
*
|
||||
* @return final comparison result
|
||||
* @see #build()
|
||||
*/
|
||||
@ -963,7 +963,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||
* the <code>builder</code> has judged the "left-hand" side
|
||||
* as less than, greater than, or equal to the "right-hand"
|
||||
* side.
|
||||
*
|
||||
*
|
||||
* @return final comparison result as an Integer
|
||||
* @see #toComparison()
|
||||
* @since 3.0
|
||||
|
@ -85,17 +85,17 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
*/
|
||||
public class HashCodeBuilder implements Builder<Integer> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* The default initial value to use in reflection hash code building.
|
||||
*/
|
||||
private static final int DEFAULT_INITIAL_VALUE = 17;
|
||||
|
||||
|
||||
/**
|
||||
* The default multipler value to use in reflection hash code building.
|
||||
*/
|
||||
private static final int DEFAULT_MULTIPLIER_VALUE = 37;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* A registry of objects used by reflection methods to detect cyclical object references and avoid infinite loops.
|
||||
@ -380,7 +380,7 @@ public class HashCodeBuilder implements Builder<Integer> {
|
||||
* if the object is <code>null</code>
|
||||
*/
|
||||
public static int reflectionHashCode(final Object object, final boolean testTransients) {
|
||||
return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object,
|
||||
return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object,
|
||||
testTransients, null);
|
||||
}
|
||||
|
||||
@ -457,7 +457,7 @@ public class HashCodeBuilder implements Builder<Integer> {
|
||||
* if the object is <code>null</code>
|
||||
*/
|
||||
public static int reflectionHashCode(final Object object, final String... excludeFields) {
|
||||
return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, false,
|
||||
return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, false,
|
||||
null, excludeFields);
|
||||
}
|
||||
|
||||
|
@ -13,13 +13,13 @@ import java.io.Serializable;
|
||||
*/
|
||||
final class IDKey implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private final Object value;
|
||||
private final int id;
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param obj 计算唯一ID的对象
|
||||
*/
|
||||
public IDKey(final Object obj) {
|
||||
@ -32,7 +32,7 @@ final class IDKey implements Serializable{
|
||||
|
||||
/**
|
||||
* returns hashcode - i.e. the system identity hashcode.
|
||||
*
|
||||
*
|
||||
* @return the hashcode
|
||||
*/
|
||||
@Override
|
||||
@ -42,7 +42,7 @@ final class IDKey implements Serializable{
|
||||
|
||||
/**
|
||||
* checks if instances are equal
|
||||
*
|
||||
*
|
||||
* @param other The other object to compare to
|
||||
* @return if the instances are for the same object
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 建造者工具<br>
|
||||
* 用于建造特定对象或结果
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
|
@ -13,19 +13,19 @@ public class CloneRuntimeException extends RuntimeException{
|
||||
public CloneRuntimeException(Throwable e) {
|
||||
super(ExceptionUtil.getMessage(e), e);
|
||||
}
|
||||
|
||||
|
||||
public CloneRuntimeException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
public CloneRuntimeException(String messageTemplate, Object... params) {
|
||||
super(StrUtil.format(messageTemplate, params));
|
||||
}
|
||||
|
||||
|
||||
public CloneRuntimeException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
}
|
||||
|
||||
|
||||
public CloneRuntimeException(Throwable throwable, String messageTemplate, Object... params) {
|
||||
super(StrUtil.format(messageTemplate, params), throwable);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user