public class ModifiableSolrParams extends SolrParams
MultiMapSolrParams
except you can edit the
parameters after it is initialized. It has helper functions to set/add
integer and boolean param values.MapWriter.EntryWriter
Constructor and Description |
---|
ModifiableSolrParams() |
ModifiableSolrParams(Map<String,String[]> v)
Constructs a new ModifiableSolrParams directly using the provided Map<String,String[]>
|
ModifiableSolrParams(SolrParams params)
Constructs a new ModifiableSolrParams, copying values from an existing SolrParams
|
Modifier and Type | Method and Description |
---|---|
void |
add(SolrParams params)
Add all of the params provided in the parameter to this params.
|
ModifiableSolrParams |
add(String name,
String... val)
Add the given values to any existing name
|
void |
clear()
clear all parameters
|
String |
get(String param)
Returns the first String value of a param, or null if not set.
|
Map<String,String[]> |
getMap() |
Set<String> |
getParameterNames() |
Iterator<String> |
getParameterNamesIterator()
Returns an Iterator over the parameter names.
|
String[] |
getParams(String param)
returns an array of the String values of a param, or null if no mapping for the param exists.
|
Iterator<Map.Entry<String,String[]>> |
iterator()
Returns an Iterator of
Map.Entry providing a multi-map view. |
static ModifiableSolrParams |
of(SolrParams params)
If the input params are of type MofifiableSolrParams, returns the input, otherwise, constructs a new
ModifiableSolrParams, copying values from the given params.
|
String[] |
remove(String name)
remove a field at the given name
|
boolean |
remove(String name,
String value)
remove the given value for the given name
|
ModifiableSolrParams |
set(String name,
boolean val) |
ModifiableSolrParams |
set(String name,
int val) |
ModifiableSolrParams |
set(String name,
String... val)
Replace any existing parameter with the given name.
|
ModifiableSolrParams |
setNonNull(String name,
Object val) |
int |
size() |
fpname, get, getAll, getAll, getBool, getBool, getDouble, getDouble, getFieldBool, getFieldBool, getFieldDouble, getFieldDouble, getFieldFloat, getFieldFloat, getFieldInt, getFieldInt, getFieldParam, getFieldParam, getFieldParams, getFloat, getFloat, getInt, getInt, getLong, getLong, getPrimitiveBool, getPrimitiveFieldBool, getPrimitiveFieldFloat, getPrimitiveInt, required, stream, toFilteredSolrParams, toLocalParamsString, toMap, toMultiMap, toNamedList, toQueryString, toSolrParams, toString, wrapAppended, wrapDefaults, writeMap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr
forEach, spliterator
public ModifiableSolrParams()
public ModifiableSolrParams(Map<String,String[]> v)
public ModifiableSolrParams(SolrParams params)
public static ModifiableSolrParams of(SolrParams params)
public int size()
public ModifiableSolrParams setNonNull(String name, Object val)
public ModifiableSolrParams set(String name, String... val)
public ModifiableSolrParams set(String name, int val)
public ModifiableSolrParams set(String name, boolean val)
public ModifiableSolrParams add(String name, String... val)
name
- Keyval
- Array of value(s) added to the name. NOTE: If val is null
or a member of val is null, then a corresponding null reference
will be included when a get method is called on the key later.public void add(SolrParams params)
public void clear()
public boolean remove(String name, String value)
public String get(String param)
SolrParams
SolrParams.getParams(String)
instead.get
in class SolrParams
public Iterator<String> getParameterNamesIterator()
SolrParams
Iterable
.getParameterNamesIterator
in class SolrParams
public String[] getParams(String param)
SolrParams
getParams
in class SolrParams
public Iterator<Map.Entry<String,String[]>> iterator()
SolrParams
Map.Entry
providing a multi-map view. Treat it as read-only.Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.