Package com.arangodb.model
Enum OverwriteMode
- java.lang.Object
-
- java.lang.Enum<OverwriteMode>
-
- com.arangodb.model.OverwriteMode
-
- All Implemented Interfaces:
Serializable
,Comparable<OverwriteMode>
public enum OverwriteMode extends Enum<OverwriteMode>
- Since:
- ArangoDB 3.7
- Author:
- Michele Rastelli
-
-
Enum Constant Summary
Enum Constants Enum Constant Description conflict
if a document with the specified _key value exists already, return a unique constraint violation error so that the insert operation fails.ignore
if a document with the specified _key value exists already, nothing will be done and no write operation will be carried out.replace
if a document with the specified _key value exists already, it will be overwritten with the specified document value.update
if a document with the specified _key value exists already, it will be patched (partially updated) with the specified document value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getValue()
static OverwriteMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static OverwriteMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ignore
public static final OverwriteMode ignore
if a document with the specified _key value exists already, nothing will be done and no write operation will be carried out. The insert operation will return success in this case. This mode does not support returning the old document version using RETURN OLD. When using RETURN NEW, null will be returned in case the document already existed.
-
replace
public static final OverwriteMode replace
if a document with the specified _key value exists already, it will be overwritten with the specified document value. This mode will also be used when no overwrite mode is specified but the overwrite flag is set to true.
-
update
public static final OverwriteMode update
if a document with the specified _key value exists already, it will be patched (partially updated) with the specified document value. The overwrite mode can be further controlled via the keepNull and mergeObjects parameters.
-
conflict
public static final OverwriteMode conflict
if a document with the specified _key value exists already, return a unique constraint violation error so that the insert operation fails. This is also the default behavior in case the overwrite mode is not set, and the overwrite flag is false or not set either.
-
-
Method Detail
-
values
public static 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 (OverwriteMode c : 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 OverwriteMode valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public String getValue()
-
-