public enum CircularReferenceMatchingMode extends java.lang.Enum<CircularReferenceMatchingMode>
CircularReferenceDetector
compares object instances. The
default is EQUALITY_OPERATOR
and this should be sufficient in mose
cases. However, you may be dealing with an object model that returns copies of its properties, instead of
reusing the exact same instance. In this cases it would be easy to end up in infinite loops, as the default
circular reference detection would not be able to detect this. In those cases you should switch to the
EQUALS_METHOD
mode. The trade-off is, that this renders you unable to nest equal but different
objects.枚举常量和说明 |
---|
EQUALITY_OPERATOR
Compares objects using the
== operator. |
EQUALS_METHOD
Compares objects using Object.equals(Object).
|
限定符和类型 | 方法和说明 |
---|---|
static CircularReferenceMatchingMode |
valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。
|
static CircularReferenceMatchingMode[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final CircularReferenceMatchingMode EQUALITY_OPERATOR
==
operator.public static final CircularReferenceMatchingMode EQUALS_METHOD
public static CircularReferenceMatchingMode[] values()
for (CircularReferenceMatchingMode c : CircularReferenceMatchingMode.values()) System.out.println(c);
public static CircularReferenceMatchingMode valueOf(java.lang.String name)
name
- 要返回的枚举常量的名称。java.lang.IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException
- 如果参数为空值