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

eu.xenit.apix.workflow.search.Facets 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 Facets {

    public Map facets;

    public Facets() {
        this.facets = new HashMap<>();
    }

    public Facets(Map facets) {
        this.facets = facets;
    }

    public void CheckValidity() {
        for (String s : facets.keySet()) {
            if (s == null) {
                throw new Error("Key of facet cannot be null");
            }
            Facet f = facets.get(s);
            for (String v : f.getValues().keySet()) {
                if (v == null) {
                    throw new Error("Value of facet with key " + s + "of facet cannot be null");
                }
            }
        }
    }

    public Map getFacets() {
        return facets;
    }

    public void setFacets(Map facets) {
        this.facets = facets;
    }

    public void AddValue(String property, String value) {
        Facet f = facets.get(property);
        if (f == null) {
            f = new Facet(property, new HashMap());
            facets.put(property, f);
        }
        f.AddValue(value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy