@@ -219,10 +219,11 @@ public <P> EnricherSpec propertyFunction(String key, Function<Message<P>, Object
219219 * Set a header with the value if it is not already present.
220220 * @param name the header name.
221221 * @param value the value.
222+ * @param <V> the value type.
222223 * @return the enricher spec.
223224 * @see ContentEnricher#setHeaderExpressions(Map)
224225 */
225- public EnricherSpec header (String name , Object value ) {
226+ public < V > EnricherSpec header (String name , V value ) {
226227 return header (name , value , null );
227228 }
228229
@@ -302,10 +303,11 @@ private EnricherSpec headerExpression(String name, Expression expression, @Nulla
302303 * Set a header value using an explicit {@link HeaderValueMessageProcessor}.
303304 * @param headerName the header name.
304305 * @param headerValueMessageProcessor the headerValueMessageProcessor.
306+ * @param <V> the value type.
305307 * @return the enricher spec.
306308 * @see ContentEnricher#setHeaderExpressions(Map)
307309 */
308- public EnricherSpec header (String headerName , HeaderValueMessageProcessor <Object > headerValueMessageProcessor ) {
310+ public < V > EnricherSpec header (String headerName , HeaderValueMessageProcessor <V > headerValueMessageProcessor ) {
309311 Assert .hasText (headerName , "'headerName' must not be empty" );
310312 this .headerExpressions .put (headerName , headerValueMessageProcessor );
311313 return _this ();
0 commit comments