Class ProtobufDataFormat.Builder
- java.lang.Object
-
- org.apache.camel.model.dataformat.ProtobufDataFormat.Builder
-
- All Implemented Interfaces:
DataFormatBuilder<ProtobufDataFormat>
- Enclosing class:
- ProtobufDataFormat
public static class ProtobufDataFormat.Builder extends Object implements DataFormatBuilder<ProtobufDataFormat>
Builder
is a specific builder forProtobufDataFormat
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtobufDataFormat.Builder
allowJmsType(boolean allowJmsType)
Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to.ProtobufDataFormat.Builder
allowJmsType(String allowJmsType)
Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to.ProtobufDataFormat.Builder
allowUnmarshallType(boolean allowUnmarshallType)
If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling.ProtobufDataFormat.Builder
allowUnmarshallType(String allowUnmarshallType)
If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling.ProtobufDataFormat.Builder
autoDiscoverObjectMapper(boolean autoDiscoverObjectMapper)
If set to true then Jackson will lookup for an objectMapper into the registryProtobufDataFormat.Builder
autoDiscoverObjectMapper(String autoDiscoverObjectMapper)
If set to true then Jackson will lookup for an objectMapper into the registryProtobufDataFormat.Builder
autoDiscoverSchemaResolver(boolean autoDiscoverSchemaResolver)
When not disabled, the SchemaResolver will be looked up into the registryProtobufDataFormat.Builder
autoDiscoverSchemaResolver(String autoDiscoverSchemaResolver)
When not disabled, the SchemaResolver will be looked up into the registryProtobufDataFormat.Builder
collectionType(Class<?> collectionType)
ProtobufDataFormat.Builder
collectionTypeName(String collectionTypeName)
Refers to a custom collection type to lookup in the registry to use.ProtobufDataFormat.Builder
contentTypeFormat(String contentTypeFormat)
Defines a content type format in which protobuf message will be serialized/deserialized from(to) the Java been.ProtobufDataFormat.Builder
contentTypeHeader(boolean contentTypeHeader)
ProtobufDataFormat.Builder
contentTypeHeader(String contentTypeHeader)
ProtobufDataFormat.Builder
defaultInstance(Object defaultInstance)
ProtobufDataFormat.Builder
disableFeatures(String disableFeatures)
Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper.ProtobufDataFormat.Builder
enableFeatures(String enableFeatures)
Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper.ProtobufDataFormat
end()
Ends the build of the data format.ProtobufDataFormat.Builder
include(String include)
If you want to marshal a pojo to JSON, and the pojo has some fields with null values.ProtobufDataFormat.Builder
instanceClass(String instanceClass)
Name of class to use when unmarshallingProtobufDataFormat.Builder
jsonView(Class<?> jsonView)
When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output.ProtobufDataFormat.Builder
jsonViewTypeName(String jsonViewTypeName)
When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output.ProtobufDataFormat.Builder
library(ProtobufLibrary library)
Which Protobuf library to use.ProtobufDataFormat.Builder
moduleClassNames(String moduleClassNames)
To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names.ProtobufDataFormat.Builder
moduleRefs(String moduleRefs)
To use custom Jackson modules referred from the Camel registry.ProtobufDataFormat.Builder
objectMapper(String objectMapper)
Lookup and use the existing ObjectMapper with the given id when using Jackson.ProtobufDataFormat.Builder
schemaResolver(String schemaResolver)
Optional schema resolver used to lookup schemas for the data in transit.ProtobufDataFormat.Builder
timezone(String timezone)
If set then Jackson will use the Timezone when marshalling/unmarshalling.ProtobufDataFormat.Builder
unmarshalType(Class<?> unmarshalType)
Class of the java type to use when unmarshallingProtobufDataFormat.Builder
unmarshalTypeName(String unmarshalTypeName)
Class name of the java type to use when unmarshallingProtobufDataFormat.Builder
useDefaultObjectMapper(boolean useDefaultObjectMapper)
Whether to lookup and use default Jackson ObjectMapper from the registry.ProtobufDataFormat.Builder
useDefaultObjectMapper(String useDefaultObjectMapper)
Whether to lookup and use default Jackson ObjectMapper from the registry.ProtobufDataFormat.Builder
useList(boolean useList)
To unmarshal to a List of Map or a List of Pojo.ProtobufDataFormat.Builder
useList(String useList)
To unmarshal to a List of Map or a List of Pojo.
-
-
-
Method Detail
-
instanceClass
public ProtobufDataFormat.Builder instanceClass(String instanceClass)
Name of class to use when unmarshalling
-
contentTypeFormat
public ProtobufDataFormat.Builder contentTypeFormat(String contentTypeFormat)
Defines a content type format in which protobuf message will be serialized/deserialized from(to) the Java been. The format can either be native or json for either native protobuf or json fields representation. The default value is native.
-
contentTypeHeader
public ProtobufDataFormat.Builder contentTypeHeader(String contentTypeHeader)
-
contentTypeHeader
public ProtobufDataFormat.Builder contentTypeHeader(boolean contentTypeHeader)
-
defaultInstance
public ProtobufDataFormat.Builder defaultInstance(Object defaultInstance)
-
library
public ProtobufDataFormat.Builder library(ProtobufLibrary library)
Which Protobuf library to use.
-
objectMapper
public ProtobufDataFormat.Builder objectMapper(String objectMapper)
Lookup and use the existing ObjectMapper with the given id when using Jackson.
-
useDefaultObjectMapper
public ProtobufDataFormat.Builder useDefaultObjectMapper(String useDefaultObjectMapper)
Whether to lookup and use default Jackson ObjectMapper from the registry.
-
useDefaultObjectMapper
public ProtobufDataFormat.Builder useDefaultObjectMapper(boolean useDefaultObjectMapper)
Whether to lookup and use default Jackson ObjectMapper from the registry.
-
unmarshalTypeName
public ProtobufDataFormat.Builder unmarshalTypeName(String unmarshalTypeName)
Class name of the java type to use when unmarshalling
-
unmarshalType
public ProtobufDataFormat.Builder unmarshalType(Class<?> unmarshalType)
Class of the java type to use when unmarshalling
-
jsonViewTypeName
public ProtobufDataFormat.Builder jsonViewTypeName(String jsonViewTypeName)
When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has @JsonView annotations
-
jsonView
public ProtobufDataFormat.Builder jsonView(Class<?> jsonView)
When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has @JsonView annotations
-
include
public ProtobufDataFormat.Builder include(String include)
If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL
-
allowJmsType
public ProtobufDataFormat.Builder allowJmsType(String allowJmsType)
Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to.
-
allowJmsType
public ProtobufDataFormat.Builder allowJmsType(boolean allowJmsType)
Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to.
-
collectionTypeName
public ProtobufDataFormat.Builder collectionTypeName(String collectionTypeName)
Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default.
-
collectionType
public ProtobufDataFormat.Builder collectionType(Class<?> collectionType)
-
useList
public ProtobufDataFormat.Builder useList(String useList)
To unmarshal to a List of Map or a List of Pojo.
-
useList
public ProtobufDataFormat.Builder useList(boolean useList)
To unmarshal to a List of Map or a List of Pojo.
-
moduleClassNames
public ProtobufDataFormat.Builder moduleClassNames(String moduleClassNames)
To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma.
-
moduleRefs
public ProtobufDataFormat.Builder moduleRefs(String moduleRefs)
To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma.
-
enableFeatures
public ProtobufDataFormat.Builder enableFeatures(String enableFeatures)
Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
-
disableFeatures
public ProtobufDataFormat.Builder disableFeatures(String disableFeatures)
Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma
-
allowUnmarshallType
public ProtobufDataFormat.Builder allowUnmarshallType(String allowUnmarshallType)
If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
-
allowUnmarshallType
public ProtobufDataFormat.Builder allowUnmarshallType(boolean allowUnmarshallType)
If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
-
timezone
public ProtobufDataFormat.Builder timezone(String timezone)
If set then Jackson will use the Timezone when marshalling/unmarshalling.
-
autoDiscoverObjectMapper
public ProtobufDataFormat.Builder autoDiscoverObjectMapper(String autoDiscoverObjectMapper)
If set to true then Jackson will lookup for an objectMapper into the registry
-
autoDiscoverObjectMapper
public ProtobufDataFormat.Builder autoDiscoverObjectMapper(boolean autoDiscoverObjectMapper)
If set to true then Jackson will lookup for an objectMapper into the registry
-
schemaResolver
public ProtobufDataFormat.Builder schemaResolver(String schemaResolver)
Optional schema resolver used to lookup schemas for the data in transit.
-
autoDiscoverSchemaResolver
public ProtobufDataFormat.Builder autoDiscoverSchemaResolver(String autoDiscoverSchemaResolver)
When not disabled, the SchemaResolver will be looked up into the registry
-
autoDiscoverSchemaResolver
public ProtobufDataFormat.Builder autoDiscoverSchemaResolver(boolean autoDiscoverSchemaResolver)
When not disabled, the SchemaResolver will be looked up into the registry
-
end
public ProtobufDataFormat end()
Description copied from interface:DataFormatBuilder
Ends the build of the data format.- Specified by:
end
in interfaceDataFormatBuilder<ProtobufDataFormat>
- Returns:
- the data format fully built.
-
-