1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-15 22:05:00 -05:00
filebot/source/net/filebot/cli/ConflictAction.java
2017-02-17 22:02:20 +08:00

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()));
}
}