T
- 被比较的Beanpublic class FieldComparator<T> extends FuncComparator<T>
comparator, nullGreater
Constructor and Description |
---|
FieldComparator(boolean nullGreater,
boolean compareSelf,
Field field)
构造
|
FieldComparator(Class<T> beanClass,
String fieldName)
构造
|
FieldComparator(Field field)
构造
|
compare, doCompare, thenComparing
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public FieldComparator(Class<T> beanClass, String fieldName)
beanClass
- Bean类fieldName
- 字段名public FieldComparator(Field field)
field
- 字段public FieldComparator(boolean nullGreater, boolean compareSelf, Field field)
nullGreater
- 是否null
在后compareSelf
- 在字段值相同情况下,是否比较对象本身。
如果此项为false
,字段值比较后为0会导致对象被认为相同,可能导致被去重。field
- 字段Copyright © 2024. All rights reserved.