![JAR search and dependency download from the Maven repository](/logo.png)
com.unbxd.client.search.response.Facets Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unbxd-java-sdk Show documentation
Show all versions of unbxd-java-sdk Show documentation
The project is a Unbxd Java Library
The newest version!
package com.unbxd.client.search.response;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
* User: sourabh
* Date: 08/07/14
* Time: 11:01 AM
* To change this template use File | Settings | File Templates.
*/
public class Facets {
private List _facets;
private Map _facetsMap;
protected Facets(Map params){
this._facets = new ArrayList();
this._facetsMap = new HashMap();
for(String field : params.keySet()){
Map facetParams = (Map) params.get(field);
String type = (String) facetParams.get("type");
Facet facet = type.equals("facet_fields") ? new Facet(field, facetParams) : new RangeFacet(field, facetParams);
this._facets.add(facet);
this._facetsMap.put(field, facet);
}
}
/**
* @return List of {@link Facet}
*/
public List getFacets(){
return this._facets;
}
/**
* @return Map of field - {@link Facet}
*/
public Map getFacetsAsMap(){
return this._facetsMap;
}
/**
* @param facetName
* @return Facet for given field name
*/
public Facet getFacet(String facetName){
return this._facetsMap.get(facetName);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy