All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.rcsb.strucmotif.update.Operation Maven / Gradle / Ivy

There is a newer version: 0.19.8
Show newest version
package org.rcsb.strucmotif.update;

import java.util.Arrays;
import java.util.NoSuchElementException;

public enum Operation {
    ADD,
    REMOVE,
    RECOVER;

    public static Operation resolve(String s) {
        String uc = s.toUpperCase();
        return Arrays.stream(Operation.values())
                .filter(e -> e.name().equals(uc))
                .findFirst()
                .orElseThrow(() -> new NoSuchElementException("Unrecognized Operation: " + s + " - options are: " + Arrays.toString(Operation.values())));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy