Skip to content

Commit

Permalink
cleanup action processor implemented in schema module, to be used by …
Browse files Browse the repository at this point in the history
…ninja and studio
  • Loading branch information
1azyman committed Dec 5, 2023
1 parent d854cdd commit 2ff44a7
Showing 1 changed file with 3 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.evolveum.midpoint.schema.util.cleanup;

import java.util.Arrays;

/**
* Cleanup action to be taken when a path is encountered.
*/
Expand All @@ -10,39 +8,18 @@ public enum CleanupPathAction {
/**
* Item is removed from the object.
*/
REMOVE("remove"),
REMOVE,

/**
* Item is not removed from the object.
*/
IGNORE("ignore"),
IGNORE,

/**
* Consumer is asked what to do.
*
* @see CleanupEventListener
* @see CleanupActionProcessor#setListener(CleanupEventListener)
*/
ASK("ask");

private final String value;

CleanupPathAction(String value) {
this.value = value;
}

public String value() {
return value;
}

public static CleanupPathAction getState(String value) {
if (value == null) {
return null;
}

return Arrays.stream(values())
.filter(s -> value.equals(s.value()))
.findFirst()
.orElse(null);
}
ASK;
}

0 comments on commit 2ff44a7

Please sign in to comment.