Class MapNamedValues
java.lang.Object
org.hibernate.search.engine.search.common.spi.MapNamedValues
- All Implemented Interfaces:
NamedValues
- Direct Known Subclasses:
QueryParameters
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
protected static interface
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MapNamedValues
(Map<String, Object> values, MapNamedValues.NamedValueMissing namedValueMissing) protected
MapNamedValues
(Map<String, Object> values, MapNamedValues.NamedValueMissing namedValueMissing, MapNamedValues.NamedValueIncorrectType namedValueIncorrectType) -
Method Summary
Modifier and TypeMethodDescriptionstatic NamedValues
Create a simple instance ofNamedValues
backed by amap
.<T> T
<T> Optional
<T> getOptional
(String name, Class<T> paramType)
-
Field Details
-
values
-
-
Constructor Details
-
MapNamedValues
protected MapNamedValues(Map<String, Object> values, MapNamedValues.NamedValueMissing namedValueMissing) -
MapNamedValues
protected MapNamedValues(Map<String, Object> values, MapNamedValues.NamedValueMissing namedValueMissing, MapNamedValues.NamedValueIncorrectType namedValueIncorrectType)
-
-
Method Details
-
fromMap
public static NamedValues fromMap(Map<String, Object> map, Function<String, SearchException> namedValueMissing) Create a simple instance ofNamedValues
backed by amap
.- Parameters:
map
- The map with values.namedValueMissing
- A function that returns an exception for the name if the value is missing.
-
get
- Specified by:
get
in interfaceNamedValues
- Type Parameters:
T
- The expected type of the value.- Parameters:
name
- The name of the value.paramType
- The expected type of the parameter.- Returns:
- The value with the given name.
-
getOptional
- Specified by:
getOptional
in interfaceNamedValues
- Type Parameters:
T
- The expected type of the value.- Parameters:
name
- The name of the value.paramType
- The expected type of the parameter.- Returns:
- An optional containing the value with the given name,
or
Optional.empty()
if there is none.
-