Class ModifiableSolrParams

    • Constructor Detail

      • ModifiableSolrParams

        public ModifiableSolrParams()
      • ModifiableSolrParams

        public ModifiableSolrParams​(Map<String,​String[]> v)
        Constructs a new ModifiableSolrParams directly using the provided Map<String,String[]>
      • ModifiableSolrParams

        public ModifiableSolrParams​(SolrParams params)
        Constructs a new ModifiableSolrParams, copying values from an existing SolrParams
    • Method Detail

      • of

        public 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. If params is null, returns an empty ModifiableSolrParams instance.
      • size

        public int size()
      • set

        public ModifiableSolrParams set​(String name,
                                        String... val)
        Replace any existing parameter with the given name. if val==null remove key from params completely.
      • add

        public ModifiableSolrParams add​(String name,
                                        String... val)
        Add the given values to any existing name
        Parameters:
        name - Key
        val - 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.
        Returns:
        this
      • add

        public void add​(SolrParams params)
        Add all of the params provided in the parameter to this params. Any current value(s) for the same key will be overridden.
      • remove

        public String[] remove​(String name)
        remove a field at the given name
      • clear

        public void clear()
        clear all parameters
      • remove

        public boolean remove​(String name,
                              String value)
        remove the given value for the given name
        Returns:
        true if the item was removed, false if null or not present
      • getParameterNamesIterator

        public Iterator<String> getParameterNamesIterator()
        Description copied from class: SolrParams
        Returns an Iterator over the parameter names. If you were to call a getter for this parameter, you should get a non-null value. Since you probably want the value, consider using Java 5 for-each style instead for convenience since a SolrParams implements Iterable.
        Specified by:
        getParameterNamesIterator in class SolrParams
      • getParameterNames

        public Set<String> getParameterNames()
      • getParams

        public String[] getParams​(String param)
        Description copied from class: SolrParams
        returns an array of the String values of a param, or null if no mapping for the param exists.
        Specified by:
        getParams in class SolrParams