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
 
 public class RequiredSolrParams extends SolrParams 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 withIn short, any value you for from a RequiredSolrParamswill return a valid non-null value or throw a 400 exception. (If you pass innullas the default value, you can get a null return value)- Since:
- solr 1.2
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriterMapWriter.EntryWriter
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected SolrParamsparams
 - 
Constructor SummaryConstructors Constructor Description RequiredSolrParams(SolrParams params)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck(String... params)Stringget(String param)get the param from params, fail if not found *Stringget(String param, String def)returns the value of the param, or def if not setbooleangetBool(String param, boolean def)Returns 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.StringgetFieldParam(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.StringgetFieldParam(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.floatgetFloat(String param, float def)Returns the float value of the param, or def if not setintgetInt(String param, int def)Returns the int value of the param, or def if not setIterator<String>getParameterNamesIterator()returns an Iterator over the parameter namesString[]getParams(String param)returns an array of the String values of a param, or null if no mapping for the param exists.StringtoString()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.SolrParamsfpname, getAll, getAll, getBool, getDouble, getDouble, getFieldBool, getFieldDouble, getFieldDouble, getFieldFloat, getFieldInt, getFloat, getInt, getLong, getLong, getPrimitiveBool, getPrimitiveFieldBool, getPrimitiveFieldFloat, getPrimitiveInt, iterator, required, stream, toFilteredSolrParams, toLocalParamsString, toMap, toMultiMap, toNamedList, toQueryString, toSolrParams, wrapAppended, wrapDefaults, writeMap
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 - 
Methods inherited from interface org.apache.solr.common.NavigableObject_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
 
- 
 
- 
- 
- 
Field Detail- 
paramsprotected final SolrParams params 
 
- 
 - 
Constructor Detail- 
RequiredSolrParamspublic RequiredSolrParams(SolrParams params) 
 
- 
 - 
Method Detail- 
getpublic String get(String param) get the param from params, fail if not found *- Specified by:
- getin class- SolrParams
 
 - 
getFieldParampublic String getFieldParam(String field, String param) 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 class- SolrParams
 
 - 
getFieldParamspublic String[] getFieldParams(String field, String param) 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 class- SolrParams
 
 - 
getParamspublic String[] getParams(String param) 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 class- SolrParams
 
 - 
getParameterNamesIteratorpublic Iterator<String> getParameterNamesIterator() returns an Iterator over the parameter names- Specified by:
- getParameterNamesIteratorin class- SolrParams
 
 - 
toStringpublic String 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 class- SolrParams
 
 - 
getpublic String get(String param, String def) Description copied from class:SolrParamsreturns the value of the param, or def if not set- Overrides:
- getin class- SolrParams
 
 - 
getIntpublic int getInt(String param, int def) Description copied from class:SolrParamsReturns the int value of the param, or def if not set- Overrides:
- getIntin class- SolrParams
 
 - 
getFloatpublic float getFloat(String param, float def) Description copied from class:SolrParamsReturns the float value of the param, or def if not set- Overrides:
- getFloatin class- SolrParams
 
 - 
getBoolpublic boolean getBool(String param, boolean def) Description copied from class:SolrParamsReturns the boolean value of the param, or def if not set- Overrides:
- getBoolin class- SolrParams
 
 - 
getFieldIntpublic int getFieldInt(String field, String param, int def) 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 class- SolrParams
 
 - 
getFieldBoolpublic boolean getFieldBool(String field, String param, boolean def) 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 class- SolrParams
 
 - 
getFieldFloatpublic float getFieldFloat(String field, String param, float def) 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 class- SolrParams
 
 - 
getFieldParampublic String getFieldParam(String field, String param, String def) 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 class- SolrParams
 
 - 
checkpublic void check(String... params) 
 
- 
 
-