Package com.fasterxml.jackson.databind
Enum JsonNode.OverwriteMode
- java.lang.Object
-
- java.lang.Enum<JsonNode.OverwriteMode>
-
- com.fasterxml.jackson.databind.JsonNode.OverwriteMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<JsonNode.OverwriteMode>
- Enclosing class:
- JsonNode
public static enum JsonNode.OverwriteMode extends java.lang.Enum<JsonNode.OverwriteMode>
Configuration setting used withJsonNode.withObject(JsonPointer)
method overrides, to indicate which overwrites are acceptable if the path pointer indicates has incompatible nodes (for example, instead of Object node a Null node is encountered). Overwrite means that the existing value is replaced with compatible type, potentially losing existing values or even sub-trees.Default value if
NULLS
which only allows Null-value nodes to be replaced but no other types.- Since:
- 2.14
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALL
Mode in which all incompatible node types may be replaced, including Array and Object nodes where necessary.NONE
Mode in which no values may be overwritten, not evenNullNode
s; only compatible paths may be traversed.NULLS
Mode in which explicitNullNode
s may be replaced but no other node types.SCALARS
Mode in which all scalar value nodes may be replaced, but not Array or Object nodes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JsonNode.OverwriteMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static JsonNode.OverwriteMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final JsonNode.OverwriteMode NONE
Mode in which no values may be overwritten, not evenNullNode
s; only compatible paths may be traversed.
-
NULLS
public static final JsonNode.OverwriteMode NULLS
Mode in which explicitNullNode
s may be replaced but no other node types.
-
SCALARS
public static final JsonNode.OverwriteMode SCALARS
Mode in which all scalar value nodes may be replaced, but not Array or Object nodes.
-
ALL
public static final JsonNode.OverwriteMode ALL
Mode in which all incompatible node types may be replaced, including Array and Object nodes where necessary.
-
-
Method Detail
-
values
public static JsonNode.OverwriteMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JsonNode.OverwriteMode c : JsonNode.OverwriteMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JsonNode.OverwriteMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-