com.browseengine.bobo.facets.DefaultFacetHandlerInitializerParam Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bobo-browse Show documentation
Show all versions of bobo-browse Show documentation
Bobo is a Faceted Search implementation written purely in Java, an extension of Apache Lucene
The newest version!
package com.browseengine.bobo.facets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* The 'generic' type for FacetHandler initialization parameters for the purpose of easy serialization.
* When this type is used, it is completely up to the program logic of the utilizing RuntimeFacetHandler
* and its client code to find the data at the right place.
* @author ymatsuda
*
*/
public class DefaultFacetHandlerInitializerParam extends FacetHandlerInitializerParam {
/**
*
*/
private static final long serialVersionUID = 1L;
private final Map _boolMap;
private final Map _intMap;
private final Map _longMap;
private final Map> _stringMap;
private final Map _byteMap;
private final Map _doubleMap;
public DefaultFacetHandlerInitializerParam() {
_boolMap = new HashMap();
_intMap = new HashMap();
_longMap = new HashMap();
_stringMap = new HashMap>();
_byteMap = new HashMap();
_doubleMap = new HashMap();
}
public Set getBooleanParamNames() {
return _boolMap.keySet();
}
public Set getStringParamNames() {
return _stringMap.keySet();
}
public Set getIntParamNames() {
return _intMap.keySet();
}
public Set getByteArrayParamNames() {
return _byteMap.keySet();
}
public Set getLongParamNames() {
return _longMap.keySet();
}
public Set getDoubleParamNames() {
return _doubleMap.keySet();
}
public DefaultFacetHandlerInitializerParam putBooleanParam(String key, boolean[] value) {
_boolMap.put(key, value);
return this;
}
public boolean[] getBooleanParam(String name) {
return _boolMap.get(name);
}
public DefaultFacetHandlerInitializerParam putByteArrayParam(String key, byte[] value) {
_byteMap.put(key, value);
return this;
}
public byte[] getByteArrayParam(String name) {
return _byteMap.get(name);
}
public DefaultFacetHandlerInitializerParam putIntParam(String key, int[] value) {
_intMap.put(key, value);
return this;
}
public int[] getIntParam(String name) {
return _intMap.get(name);
}
public DefaultFacetHandlerInitializerParam putLongParam(String key, long[] value) {
_longMap.put(key, value);
return this;
}
public long[] getLongParam(String name) {
return _longMap.get(name);
}
public DefaultFacetHandlerInitializerParam putStringParam(String key, List value) {
_stringMap.put(key, value);
return this;
}
public List getStringParam(String name) {
return _stringMap.get(name);
}
public DefaultFacetHandlerInitializerParam putDoubleParam(String key, double[] value) {
_doubleMap.put(key, value);
return this;
}
public double[] getDoubleParam(String name) {
return _doubleMap.get(name);
}
public void clear() {
_boolMap.clear();
_intMap.clear();
_longMap.clear();
_stringMap.clear();
_byteMap.clear();
}
}