public class DefaultClaims extends JwtMap implements Claims
AUDIENCE, DESCRIPTION, EXPIRATION, ID, ISSUED_AT, ISSUER, NOT_BEFORE, SUBJECT
构造器和说明 |
---|
DefaultClaims() |
DefaultClaims(java.util.Map<java.lang.String,java.lang.Object> map) |
限定符和类型 | 方法和说明 |
---|---|
<T> T |
get(java.lang.String claimName,
java.lang.Class<T> requiredType) |
java.lang.String |
getAudience()
Returns the JWT
aud (audience) value or null if not present. |
java.lang.String |
getDescription() |
java.util.Date |
getExpiration()
Returns the JWT
exp (expiration) timestamp or null if not present. |
java.lang.String |
getId()
Returns the JWTs
jti (JWT ID) value or null if not present. |
java.util.Date |
getIssuedAt()
Returns the JWT
iat (issued at) timestamp or null if not present. |
java.lang.String |
getIssuer()
Returns the JWT
iss (issuer) value or null if not present. |
java.util.Date |
getNotBefore()
Returns the JWT
nbf (not before) timestamp or null if not present. |
java.lang.String |
getSubject()
Returns the JWT
sub (subject) value or null if not present. |
Claims |
setAudience(java.lang.String aud)
Sets the JWT
aud (audience) value. |
Claims |
setDescription(java.lang.String description) |
Claims |
setExpiration(java.util.Date exp)
Sets the JWT
exp (expiration) timestamp. |
Claims |
setId(java.lang.String jti)
Sets the JWT
jti (JWT ID) value. |
Claims |
setIssuedAt(java.util.Date iat)
Sets the JWT
iat (issued at) timestamp. |
Claims |
setIssuer(java.lang.String iss)
Sets the JWT
iss (issuer) value. |
Claims |
setNotBefore(java.util.Date nbf)
Sets the JWT
nbf (not before) timestamp. |
Claims |
setSubject(java.lang.String sub)
Sets the JWT
sub (subject) value. |
public DefaultClaims()
public DefaultClaims(java.util.Map<java.lang.String,java.lang.Object> map)
public java.lang.String getIssuer()
Claims
iss
(issuer) value or null
if not present.public Claims setIssuer(java.lang.String iss)
Claims
iss
(issuer) value. A null
value will remove the property from the JSON map.setIssuer
在接口中 Claims
setIssuer
在接口中 ClaimsMutator<Claims>
iss
- the JWT iss
value or null
to remove the property from the JSON map.Claims
instance for method chaining.public java.lang.String getSubject()
Claims
sub
(subject) value or null
if not present.getSubject
在接口中 Claims
sub
value or null
if not present.public Claims setSubject(java.lang.String sub)
Claims
sub
(subject) value. A null
value will remove the property from the JSON map.setSubject
在接口中 Claims
setSubject
在接口中 ClaimsMutator<Claims>
sub
- the JWT sub
value or null
to remove the property from the JSON map.Claims
instance for method chaining.public java.lang.String getAudience()
Claims
aud
(audience) value or null
if not present.getAudience
在接口中 Claims
aud
value or null
if not present.public Claims setAudience(java.lang.String aud)
Claims
aud
(audience) value. A null
value will remove the property from the JSON map.setAudience
在接口中 Claims
setAudience
在接口中 ClaimsMutator<Claims>
aud
- the JWT aud
value or null
to remove the property from the JSON map.Claims
instance for method chaining.public java.util.Date getExpiration()
Claims
exp
(expiration) timestamp or null
if not present.
A JWT obtained after this timestamp should not be used.
getExpiration
在接口中 Claims
exp
value or null
if not present.public Claims setExpiration(java.util.Date exp)
Claims
exp
(expiration) timestamp. A null
value will remove the property from the JSON map.
A JWT obtained after this timestamp should not be used.
setExpiration
在接口中 Claims
setExpiration
在接口中 ClaimsMutator<Claims>
exp
- the JWT exp
value or null
to remove the property from the JSON map.Claims
instance for method chaining.public java.util.Date getNotBefore()
Claims
nbf
(not before) timestamp or null
if not present.
A JWT obtained before this timestamp should not be used.
getNotBefore
在接口中 Claims
nbf
value or null
if not present.public Claims setNotBefore(java.util.Date nbf)
Claims
nbf
(not before) timestamp. A null
value will remove the property from the JSON map.
A JWT obtained before this timestamp should not be used.
setNotBefore
在接口中 Claims
setNotBefore
在接口中 ClaimsMutator<Claims>
nbf
- the JWT nbf
value or null
to remove the property from the JSON map.Claims
instance for method chaining.public java.util.Date getIssuedAt()
Claims
iat
(issued at) timestamp or null
if not present.
If present, this value is the timestamp when the JWT was created.
getIssuedAt
在接口中 Claims
nbf
value or null
if not present.public Claims setIssuedAt(java.util.Date iat)
Claims
iat
(issued at) timestamp. A null
value will remove the property from the JSON map.
The value is the timestamp when the JWT was created.
setIssuedAt
在接口中 Claims
setIssuedAt
在接口中 ClaimsMutator<Claims>
iat
- the JWT iat
value or null
to remove the property from the JSON map.Claims
instance for method chaining.public java.lang.String getId()
Claims
jti
(JWT ID) value or null
if not present.
This value is a CaSe-SenSiTiVe unique identifier for the JWT. If available, this value is expected to be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object. The ID can be used to prevent the JWT from being replayed.
public Claims setId(java.lang.String jti)
Claims
jti
(JWT ID) value. A null
value will remove the property from the JSON map.
This value is a CaSe-SenSiTiVe unique identifier for the JWT. If specified, this value MUST be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object. The ID can be used to prevent the JWT from being replayed.
setId
在接口中 Claims
setId
在接口中 ClaimsMutator<Claims>
jti
- the JWT jti
value or null
to remove the property from the JSON map.Claims
instance for method chaining.public java.lang.String getDescription()
getDescription
在接口中 Claims
public Claims setDescription(java.lang.String description)
setDescription
在接口中 Claims
setDescription
在接口中 ClaimsMutator<Claims>