public enum CircularReferenceMatchingMode extends 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.Enum Constant and Description |
---|
EQUALITY_OPERATOR
Compares objects using the
== operator. |
EQUALS_METHOD
Compares objects using Object.equals(Object).
|
Modifier and Type | Method and Description |
---|---|
static CircularReferenceMatchingMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CircularReferenceMatchingMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
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(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullCopyright © 2016. All rights reserved.