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

eu.xenit.apix.workflow.search.Facet Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
package eu.xenit.apix.workflow.search;

import java.util.HashMap;
import java.util.Map;

public class Facet {

    public String property;
    public Map values;

    public Facet() {
        values = new HashMap<>();
    }

    public Facet(String property, Map values) {
        this.property = property;
        this.values = values;
    }

    public void AddValue(String value) {
        if (value == null) {
            throw new Error("Cannot add null as value for facet " + this.property);
        }
        FacetValue fVal = values.get(value);
        if (fVal == null) {
            fVal = new FacetValue(value, 0);
            values.put(value, fVal);
        }
        fVal.amount++;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public Map getValues() {
        return values;
    }

    public void setValues(Map values) {
        this.values = values;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy