Spring Data Solr

org.springframework.data.solr.core.query
Class FieldWithQueryParameters<T extends QueryParameter>

java.lang.Object
  extended by org.springframework.data.solr.core.query.SimpleField
      extended by org.springframework.data.solr.core.query.FieldWithQueryParameters<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterable<T>, Field
Direct Known Subclasses:
FacetOptions.FieldWithFacetParameters, HighlightOptions.FieldWithHighlightParameters

public class FieldWithQueryParameters<T extends QueryParameter>
extends SimpleField
implements Iterable<T>

Field that holds additional parameters to provide query hints to solr.

Author:
Christoph Strobl

Constructor Summary
FieldWithQueryParameters(String fieldname)
           
 
Method Summary
 void addQueryParameter(T parameter)
           
 T getQueryParameter(String parameterName)
          Get the parameter for given name.
 Collection<T> getQueryParameters()
          Get Collection of all parameters
<S> S
getQueryParameterValue(String parameterName)
          Get value of given parameter
 boolean hasQueryParameters()
           
 Iterator<T> iterator()
           
 T removeQueryParameter(String parameterName)
          remove parameter with given name
 
Methods inherited from class org.springframework.data.solr.core.query.SimpleField
getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldWithQueryParameters

public FieldWithQueryParameters(String fieldname)
Parameters:
fieldname - must not be null
Method Detail

getQueryParameter

public T getQueryParameter(String parameterName)
Get the parameter for given name.

Parameters:
parameterName -
Returns:
null if parameter does not exist

addQueryParameter

public void addQueryParameter(T parameter)
Parameters:
parameter - must not be null

removeQueryParameter

public T removeQueryParameter(String parameterName)
remove parameter with given name

Parameters:
parameterName -

getQueryParameters

public Collection<T> getQueryParameters()
Get Collection of all parameters

Returns:

hasQueryParameters

public boolean hasQueryParameters()
Returns:
true if parameters present

getQueryParameterValue

public <S> S getQueryParameterValue(String parameterName)
Get value of given parameter

Parameters:
parameterName -
Returns:
null if no parameter with given name present

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends QueryParameter>

Spring Data Solr

Copyright © 2011-2014-2014 Pivotal. All Rights Reserved.