public static class PlainHeader.Builder extends java.lang.Object
Example use:
PlainHeader header = new PlainHeader.Builder(). contentType("text/plain"). customParam("exp", new Date().getTime()). build();
Constructor and Description |
---|
PlainHeader.Builder()
Creates a new plain header builder.
|
PlainHeader.Builder(PlainHeader plainHeader)
Creates a new plain header builder with the parameters from
the specified header.
|
Modifier and Type | Method and Description |
---|---|
PlainHeader |
build()
Builds a new plain header.
|
PlainHeader.Builder |
contentType(java.lang.String cty)
Sets the content type (
cty ) parameter. |
PlainHeader.Builder |
criticalParams(java.util.Set<java.lang.String> crit)
Sets the critical header parameters (
crit )
parameter. |
PlainHeader.Builder |
customParam(java.lang.String name,
java.lang.Object value)
Sets a custom (non-registered) parameter.
|
PlainHeader.Builder |
customParams(java.util.Map<java.lang.String,java.lang.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 PlainHeader.Builder()
public PlainHeader.Builder(PlainHeader plainHeader)
plainHeader
- The plain 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(java.lang.String cty)
cty
) parameter.cty
- The content type parameter, null
if not
specified.public PlainHeader.Builder criticalParams(java.util.Set<java.lang.String> crit)
crit
)
parameter.crit
- The names of the critical header parameters,
empty set or null
if none.public PlainHeader.Builder customParam(java.lang.String name, java.lang.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.java.lang.IllegalArgumentException
- If the specified parameter
name matches a registered
parameter name.public PlainHeader.Builder customParams(java.util.Map<java.lang.String,java.lang.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 © 2014 Connect2id Ltd.. All Rights Reserved.