Class FieldWithQueryParameters<T extends QueryParameter>

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

public class FieldWithQueryParameters<T extends QueryParameter> extends SimpleField implements Iterable<T>
Field that holds additional parameters to provide query hints to solr.
  • Constructor Details

    • FieldWithQueryParameters

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

    • 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>