public static class PlainHeader.Builder extends Object
Example usage:
PlainHeader header = new PlainHeader.Builder().
contentType("text/plain").
customParam("exp", new Date().getTime()).
build();
| Constructor and Description |
|---|
Builder()
Creates a new unsecured (plain) header builder.
|
Builder(PlainHeader plainHeader)
Creates a new unsecured (plain) header builder with the
parameters from the specified header.
|
| Modifier and Type | Method and Description |
|---|---|
PlainHeader |
build()
Builds a new unsecured (plain) header.
|
PlainHeader.Builder |
contentType(String cty)
Sets the content type (
cty) parameter. |
PlainHeader.Builder |
criticalParams(Set<String> crit)
Sets the critical header parameters (
crit)
parameter. |
PlainHeader.Builder |
customParam(String name,
Object value)
Sets a custom (non-registered) parameter.
|
PlainHeader.Builder |
customParams(Map<String,Object> customParameters)
Sets the custom (non-registered) parameters.
|
PlainHeader.Builder |
parsedBase64URL(Base64URL base64URL)
Sets the parsed Base64URL.
|
PlainHeader.Builder |
type(JOSEObjectType typ)
Sets the type (
typ) parameter. |
public Builder()
public Builder(PlainHeader plainHeader)
plainHeader - The unsecured header to use. Must not be
null.public PlainHeader.Builder type(JOSEObjectType typ)
typ) parameter.typ - The type parameter, null if not
specified.public PlainHeader.Builder contentType(String cty)
cty) parameter.cty - The content type parameter, null if not
specified.public PlainHeader.Builder criticalParams(Set<String> crit)
crit)
parameter.crit - The names of the critical header parameters,
empty set or null if none.public PlainHeader.Builder customParam(String name, Object value)
name - The name of the custom parameter. Must not
match a registered parameter name and must not
be null.value - The value of the custom parameter, should map
to a valid JSON entity, null if not
specified.IllegalArgumentException - If the specified parameter
name matches a registered
parameter name.public PlainHeader.Builder customParams(Map<String,Object> customParameters)
customParameters - The custom parameters, empty map or
null if none.public PlainHeader.Builder parsedBase64URL(Base64URL base64URL)
base64URL - The parsed Base64URL, null if the
header is created from scratch.public PlainHeader build()
Copyright © 2018 Connect2id Ltd.. All rights reserved.