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

it.ness.queryable.annotations.QOption Maven / Gradle / Ivy

There is a newer version: 3.0.3
Show newest version
package it.ness.queryable.annotations;

import java.util.ArrayList;
import java.util.List;

public enum QOption {

    EXECUTE_ALWAYS, WITHOUT_PARAMETERS;

    public static QOption[] from(String value) {
        if (value.contains(",")) {
            String[] options = value.split(",");
            List qOptions = new ArrayList<>();
            for (String opt : options) {
                opt = opt.replace("{", "").replace("}", "").replace("QOption.", "");
                qOptions.add(QOption.valueOf(value));
            }
            return qOptions.toArray(new QOption[]{});
        } else {
            value = value.replace("{", "").replace("}", "").replace("QOption.", "");
            return new QOption[]{QOption.valueOf(value)};
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy