Interface JOSEObjectBuilder<A,B extends JOSEHeader,C extends JOSEObject<A,B>,D extends JOSEHeaderConfigurator<D>,E extends JOSEObjectBuilder<A,B,C,D,E>>
- Type Parameters:
A
- the payload typeB
- the JOSE header typeC
- the JOSE object typeD
- the JOSE header configurator typeE
- the JOSE object builder type
- All Known Subinterfaces:
JWEBuilder<A,
,B, C> JWSBuilder<A,
B, C>
A JOSE object builder is used to build single JOSE objects.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the JOSE object.Builds the JOSE object using the specified payload media type.Builds the JOSE object using the specified payload encoder.Specifies the JOSE header.Specifies the JOSE object payload.
-
Method Details
-
header
Specifies the JOSE header.
- Parameters:
configurer
- a JOSE header configurer- Returns:
- this builder
-
payload
Specifies the JOSE object payload.
- Parameters:
payload
- a payload- Returns:
- this builder
-
build
Builds the JOSE object.
The builder will rely on the payload media type specified in the JOSE header to determine how to serialize the payload. The operation will fail if it is not able to determine the media type converter to use. Please consider other build methods
build(java.lang.String)
andbuild(java.util.function.Function)
to explicitly specifies how the payload should be serialized.- Returns:
- a single JOSE object publisher
- Throws:
JOSEObjectBuildException
- if there was an error building the JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
build
Builds the JOSE object using the specified payload media type.
The builder will use the specified media type to determine the converter to use to serialize the payload and ignore the content type specified in the JOSE header. The operation will fail if there is no media type converters defined for that particular media type. Media types converters are provided when building the JOSE module. Please consider build method
build(java.util.function.Function)
to provide a custom payload encoder.- Parameters:
contentType
- the payload media type- Returns:
- a single JOSE object publisher
- Throws:
JOSEObjectBuildException
- if there was an error building the JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
build
Mono<C> build(Function<A, Mono<String>> payloadEncoder) throws JOSEObjectBuildException, JOSEProcessingExceptionBuilds the JOSE object using the specified payload encoder.
The builder will use the specified payload encoder to serialize the payload and ignore the content type specified in the JOSE header.
- Parameters:
payloadEncoder
- a payload encoder- Returns:
- a single JOSE object publisher
- Throws:
JOSEObjectBuildException
- if there was an error building the JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-