mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-15 22:05:00 -05:00
27 lines
562 B
Java
27 lines
562 B
Java
package net.filebot.cli;
|
|
|
|
import static java.util.Arrays.*;
|
|
import static java.util.stream.Collectors.*;
|
|
|
|
import java.util.List;
|
|
|
|
public enum ConflictAction {
|
|
|
|
SKIP, OVERRIDE, FAIL, AUTO, INDEX;
|
|
|
|
public static List<String> names() {
|
|
return stream(values()).map(Enum::name).collect(toList());
|
|
}
|
|
|
|
public static ConflictAction forName(String name) {
|
|
for (ConflictAction action : values()) {
|
|
if (action.name().equalsIgnoreCase(name)) {
|
|
return action;
|
|
}
|
|
}
|
|
|
|
throw new IllegalArgumentException(String.format("%s not in %s", name, names()));
|
|
}
|
|
|
|
}
|