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 interfaceprotected static interface -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMapNamedValues(Map<String, Object> values, MapNamedValues.NamedValueMissing namedValueMissing) protectedMapNamedValues(Map<String, Object> values, MapNamedValues.NamedValueMissing namedValueMissing, MapNamedValues.NamedValueIncorrectType namedValueIncorrectType) -
Method Summary
Modifier and TypeMethodDescriptionstatic NamedValuesfromMap(Map<String, Object> map, Function<String, org.hibernate.search.util.common.SearchException> namedValueMissing) Create a simple instance ofNamedValuesbacked 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, org.hibernate.search.util.common.SearchException> namedValueMissing) Create a simple instance ofNamedValuesbacked 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:
getin 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:
getOptionalin 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.
-