Package org.apache.solr.common.params
Class RequiredSolrParams
java.lang.Object
org.apache.solr.common.params.SolrParams
org.apache.solr.common.params.RequiredSolrParams
- All Implemented Interfaces:
Serializable,Iterable<Map.Entry<String,,String[]>> MapSerializable,MapWriter,NavigableObject,org.noggit.JSONWriter.Writable
This is a simple wrapper to SolrParams that will throw a 400 exception if you ask for a parameter
that does not exist. Fields specified with
In short, any value you for from a RequiredSolrParams will return a valid
non-null value or throw a 400 exception. (If you pass in null as the default value,
you can get a null return value)
- Since:
- solr 1.2
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidget the param from params, fail if not found *returns the value of the param, or def if not setbooleanReturns the boolean value of the param, or def if not setbooleangetFieldBool(String field, String param, boolean def) Returns the boolean value of the field param, or the value for param, or def if neither is set.floatgetFieldFloat(String field, String param, float def) Returns the float value of the field param, or the value for param, or def if neither is set.intgetFieldInt(String field, String param, int def) Returns the int value of the field param, or the value for param, or def if neither is set.getFieldParam(String field, String param) returns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set.getFieldParam(String field, String param, String def) returns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set.String[]getFieldParams(String field, String param) returns the String values of the field parameter, "f.field.param", or the values for "param" if that is not set.floatReturns the float value of the param, or def if not setintReturns the int value of the param, or def if not setreturns an Iterator over the parameter namesString[]returns an array of the String values of a param, or null if no mapping for the param exists.toString()LikeSolrParams.toQueryString(), but only replacing enough chars so that the URL may be unambiguously pasted back into a browser.Methods inherited from class org.apache.solr.common.params.SolrParams
equals, fpname, getBool, getDouble, getDouble, getFieldBool, getFieldDouble, getFieldDouble, getFieldFloat, getFieldInt, getFloat, getInt, getLong, getLong, getPrimitiveBool, getPrimitiveFieldBool, getPrimitiveFieldFloat, getPrimitiveInt, hashCode, iterator, of, of, required, stream, toLocalParamsString, toNamedList, toQueryString, wrapAppended, wrapDefaults, writeMapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
-
Field Details
-
params
-
-
Constructor Details
-
RequiredSolrParams
-
-
Method Details
-
get
get the param from params, fail if not found *- Specified by:
getin classSolrParams
-
getFieldParam
Description copied from class:SolrParamsreturns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set.- Overrides:
getFieldParamin classSolrParams
-
getFieldParams
Description copied from class:SolrParamsreturns the String values of the field parameter, "f.field.param", or the values for "param" if that is not set.- Overrides:
getFieldParamsin classSolrParams
-
getParams
Description copied from class:SolrParamsreturns an array of the String values of a param, or null if no mapping for the param exists.- Specified by:
getParamsin classSolrParams
-
getParameterNamesIterator
returns an Iterator over the parameter names- Specified by:
getParameterNamesIteratorin classSolrParams
-
toString
Description copied from class:SolrParamsLikeSolrParams.toQueryString(), but only replacing enough chars so that the URL may be unambiguously pasted back into a browser. This method can be used to properly log query parameters without making them unreadable.Characters with a numeric value less than 32 are encoded. &,=,%,+,space are encoded.
- Overrides:
toStringin classSolrParams
-
get
Description copied from class:SolrParamsreturns the value of the param, or def if not set- Overrides:
getin classSolrParams
-
getInt
Description copied from class:SolrParamsReturns the int value of the param, or def if not set- Overrides:
getIntin classSolrParams
-
getFloat
Description copied from class:SolrParamsReturns the float value of the param, or def if not set- Overrides:
getFloatin classSolrParams
-
getBool
Description copied from class:SolrParamsReturns the boolean value of the param, or def if not set- Overrides:
getBoolin classSolrParams
-
getFieldInt
Description copied from class:SolrParamsReturns the int value of the field param, or the value for param, or def if neither is set.- Overrides:
getFieldIntin classSolrParams
-
getFieldBool
Description copied from class:SolrParamsReturns the boolean value of the field param, or the value for param, or def if neither is set.- Overrides:
getFieldBoolin classSolrParams
-
getFieldFloat
Description copied from class:SolrParamsReturns the float value of the field param, or the value for param, or def if neither is set.- Overrides:
getFieldFloatin classSolrParams
-
getFieldParam
Description copied from class:SolrParamsreturns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set. If that is not set, def- Overrides:
getFieldParamin classSolrParams
-
check
-