package uk.ac.ebi.quickgo.rest.search;

/**
 * Enumerates the aggregation functions supported by the domain.
 *
 * @author Ricardo Antunes
 */
public enum AggregateFunction {
    COUNT("count"),
    UNIQUE("unique");

    private String name;

    AggregateFunction(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static AggregateFunction typeOf(String functionText) {
        for(AggregateFunction function : AggregateFunction.values()) {
            if(function.getName().equals(functionText)) {
                return function;
            }
        }

        throw new IllegalArgumentException("Unable to find aggregation function for: " + functionText);
    }
}

@@ -208,16 +208,32 @@
 unique%22)
+,%0A    SUM(%22sum%22)
 ;%0A%0A    p

Add sum aggregation as a supported function in QuickGO.