Class CloudEventHeadersBuilder
java.lang.Object
org.springframework.integration.support.MapBuilder<CloudEventHeadersBuilder, String, @Nullable Object>
org.springframework.integration.cloudevents.dsl.CloudEventHeadersBuilder
public class CloudEventHeadersBuilder
extends MapBuilder<CloudEventHeadersBuilder, String, @Nullable Object>
The CloudEvent specific
MapBuilder implementation.
Provide a fluent API for building CloudEvent headers with support for literal values, SpEL expressions, and function-based values.
- Since:
- 7.1
- Author:
- Glenn Renfro
-
Field Summary
Fields inherited from class org.springframework.integration.support.MapBuilder
PARSER -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newCloudEventHeadersBuilderwith default prefix.CloudEventHeadersBuilder(String prefix) Create a newCloudEventHeadersBuilderwith the given prefix. -
Method Summary
Modifier and TypeMethodDescriptiondataContentType(@Nullable String dataContentType) Set the CloudEvent data content type.dataContentTypeExpression(String dataContentType) Set the expression that will be evaluated to determine the CloudEvent data content type.dataContentTypeFunction(Function<Message<P>, String> dataContentType) Set a function that will be invoked to determine the CloudEvent data content type.dataSchema(@Nullable URI dataSchema) Set the CloudEvent data schema.dataSchemaExpression(String dataSchema) Set the expression that will be evaluated to determine the CloudEvent data schema.dataSchemaFunction(Function<Message<P>, URI> dataSchema) Set a function that will be invoked to determine the CloudEvent data schema.Set the CloudEvent id.idExpression(String id) Set the expression that will be evaluated to determine the CloudEvent id.idFunction(Function<Message<P>, String> id) Set a function that will be invoked to determine the CloudEvent id.Set the CloudEvent source.sourceExpression(String source) Set the expression that will be evaluated to determine the CloudEvent source.sourceFunction(Function<Message<P>, URI> source) Set a function that will be invoked to determine the CloudEvent source.Set the CloudEvent subject.subjectExpression(String subject) Set the expression that will be evaluated to determine the CloudEvent subject.subjectFunction(Function<Message<P>, String> subject) Set a function that will be invoked to determine the CloudEvent subject.time(@Nullable OffsetDateTime time) Set the CloudEvent time.timeExpression(String time) Set the expression that will be evaluated to determine the CloudEvent time.timeFunction(Function<Message<P>, OffsetDateTime> time) Set a function that will be invoked to determine the CloudEvent time.Set the CloudEvent type.typeExpression(String type) Set the expression that will be evaluated to determine the CloudEvent type.typeFunction(Function<Message<P>, String> type) Set a function that will be invoked to determine the CloudEvent type.Methods inherited from class org.springframework.integration.support.MapBuilder
_this, get, put
-
Constructor Details
-
CloudEventHeadersBuilder
public CloudEventHeadersBuilder()Create a newCloudEventHeadersBuilderwith default prefix. -
CloudEventHeadersBuilder
Create a newCloudEventHeadersBuilderwith the given prefix.- Parameters:
prefix- the CloudEvent header prefix
-
-
Method Details
-
id
Set the CloudEvent id.- Parameters:
id- the event id- Returns:
- the builder
-
idExpression
Set the expression that will be evaluated to determine the CloudEvent id.- Parameters:
id- the SpEL expression- Returns:
- the builder
-
idFunction
Set a function that will be invoked to determine the CloudEvent id.- Parameters:
id- the function- Returns:
- the builder
-
source
Set the CloudEvent source.- Parameters:
source- the event source URI- Returns:
- the builder
-
sourceExpression
Set the expression that will be evaluated to determine the CloudEvent source.- Parameters:
source- the SpEL expression- Returns:
- the builder
-
sourceFunction
Set a function that will be invoked to determine the CloudEvent source.- Parameters:
source- the function- Returns:
- the builder
-
type
Set the CloudEvent type.- Parameters:
type- the event type- Returns:
- the builder
-
typeExpression
Set the expression that will be evaluated to determine the CloudEvent type.- Parameters:
type- the SpEL expression- Returns:
- the builder
-
typeFunction
Set a function that will be invoked to determine the CloudEvent type.- Parameters:
type- the function- Returns:
- the builder
-
time
Set the CloudEvent time.- Parameters:
time- the event timestamp- Returns:
- the builder
-
timeExpression
Set the expression that will be evaluated to determine the CloudEvent time.- Parameters:
time- the SpEL expression- Returns:
- the builder
-
timeFunction
Set a function that will be invoked to determine the CloudEvent time.- Parameters:
time- the function- Returns:
- the builder
-
subject
Set the CloudEvent subject.- Parameters:
subject- the event subject- Returns:
- the builder
-
subjectExpression
Set the expression that will be evaluated to determine the CloudEvent subject.- Parameters:
subject- the SpEL expression- Returns:
- the builder
-
subjectFunction
Set a function that will be invoked to determine the CloudEvent subject.- Parameters:
subject- the function- Returns:
- the builder
-
dataContentType
Set the CloudEvent data content type.- Parameters:
dataContentType- the data content type- Returns:
- the builder
-
dataContentTypeExpression
Set the expression that will be evaluated to determine the CloudEvent data content type.- Parameters:
dataContentType- the SpEL expression- Returns:
- the builder
-
dataContentTypeFunction
public <P> CloudEventHeadersBuilder dataContentTypeFunction(Function<Message<P>, String> dataContentType) Set a function that will be invoked to determine the CloudEvent data content type.- Parameters:
dataContentType- the function- Returns:
- the builder
-
dataSchema
Set the CloudEvent data schema.- Parameters:
dataSchema- the data schema URI- Returns:
- the builder
-
dataSchemaExpression
Set the expression that will be evaluated to determine the CloudEvent data schema.- Parameters:
dataSchema- the SpEL expression- Returns:
- the builder
-
dataSchemaFunction
Set a function that will be invoked to determine the CloudEvent data schema.- Parameters:
dataSchema- the function- Returns:
- the builder
-