java.lang.Object
org.cruk.clarity.api.search.SearchTerm
- All Implemented Interfaces:
Serializable
Class recording an individual parameter and its value or values of a
call to the API's
find
method.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSearchTerm
(String param) Create a search term with no values.SearchTerm
(String param, Collection<? extends Object> values) Create a search term with the given values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether the given object is equal to this SearchTerm.getParam()
Get the parameter name.Get the values to search for for this parameter.int
hashCode()
Override of hash code.void
Set the parameter name.void
Set the single value to search for.void
Set the values to search for from an array.void
setValues
(Collection<? extends Object> values) Set the values to search for from a collection.void
Set the values to search for from a stream.toString()
Get a human readable representation of this object.
-
Constructor Details
-
SearchTerm
Create a search term with no values.- Parameters:
param
- The parameter name.- Throws:
IllegalArgumentException
- ifparam
is null or empty.
-
SearchTerm
Create a search term with the given values.- Parameters:
param
- The parameter name.values
- A collection of values to search for with this parameter.- Throws:
IllegalArgumentException
- ifparam
is null or empty.
-
-
Method Details
-
getParam
Get the parameter name.- Returns:
- The parameter name.
-
setParam
Set the parameter name.- Parameters:
param
- The parameter name.- Throws:
IllegalArgumentException
- ifparam
is null or empty.
-
getValues
Get the values to search for for this parameter.- Returns:
- A list of values.
-
setValues
Set the values to search for from a stream.- Parameters:
values
- The values to search for. Any null or empty values are filtered out.
-
setValues
Set the values to search for from a collection.- Parameters:
values
- The values to search for. Any null or empty values are filtered out.
-
setValues
Set the values to search for from an array.- Parameters:
values
- The values to search for. Any null or empty values are filtered out.
-
setValue
Set the single value to search for.- Parameters:
value
- The value.
-
hashCode
public int hashCode()Override of hash code. The hash should be based on the parameter name and the values. The order of values is not important. -
equals
Test whether the given object is equal to this SearchTerm. It will be if it is also a SearchTerm object that has the same parameter name with the same search values (order unimportant). -
toString
Get a human readable representation of this object. Gives the parameter name and values.
-