Class JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder
java.lang.Object
org.springframework.pulsar.support.header.JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder
- Enclosing class:
- JsonPulsarHeaderMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
inboundPatterns
(String... patterns) Adds to the list of patterns to be used for inbound header matching.objectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets the object mapper to use to read/write header values as JSON.outboundPatterns
(String... patterns) Adds to the list of patterns to be used for outbound header matching.toStringClasses
(String... classNames) Add class names to the list of classes that should be serialized using theirObject.toString()
method.trustedPackages
(String... packages) Add packages to the list of trusted packages used when constructing objects from JSON.
-
Constructor Details
-
JsonPulsarHeaderMapperBuilder
public JsonPulsarHeaderMapperBuilder()
-
-
Method Details
-
objectMapper
public JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder objectMapper(@Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets the object mapper to use to read/write header values as JSON.- Parameters:
objectMapper
- the object mapper- Returns:
- current builder
-
trustedPackages
Add packages to the list of trusted packages used when constructing objects from JSON.NOTE:If a class for a non-trusted package is encountered, the header is returned to the application with value of type
JsonPulsarHeaderMapper.NonTrustedHeaderType
.- Parameters:
packages
- the packages to include in the trusted list - if any entry is"*"
all packages are trusted- Returns:
- current builder
-
toStringClasses
Add class names to the list of classes that should be serialized using theirObject.toString()
method.- Parameters:
classNames
- the class names to add to the 'toString' list- Returns:
- current builder
-
inboundPatterns
Adds to the list of patterns to be used for inbound header matching.- Parameters:
patterns
- inbound patterns to add- Returns:
- current builder
-
outboundPatterns
Adds to the list of patterns to be used for outbound header matching.- Parameters:
patterns
- outbound patterns to add- Returns:
- current builder
-
build
-