- MERGE(true), REPLACE(true), CREATE(false), DELETE(false), REMOVE(false), NONE(true, false);
-
- public static ModifyAction fromXmlValue(final String xmlNameOfAction) {
- switch (xmlNameOfAction) {
- case "merge":
- return MERGE;
- case "replace":
- return REPLACE;
- case "remove":
- return REMOVE;
- case "delete":
- return DELETE;
- case "create":
- return CREATE;
- case "none":
- return NONE;
- default:
- throw new IllegalArgumentException("Unknown operation " + xmlNameOfAction + " available operations "
- + Arrays.toString(ModifyAction.values()));
- }
- }
+ // operation and default-operation
+ MERGE("merge", true, true),
+ REPLACE("replace", true, true),
+ // operation only
+ CREATE("create", true, false),
+ DELETE("delete", true, false),
+ REMOVE("remove", true, false),
+
+ // default-operation-only
+ NONE("none", false, true);
+
+ private final @NonNull String xmlValue;
+ private final boolean isDefaultOperation;
+ private final boolean isOperation;