mirror of https://github.com/jwtk/jjwt.git
Merge pull request #472 from longtimeago/84
#84 JwtBuilder.setClaims() now accepts `Map<String, ?> claims`
This commit is contained in:
commit
ec3298af18
|
@ -21,7 +21,6 @@ import io.jsonwebtoken.io.Encoder;
|
|||
import io.jsonwebtoken.io.Serializer;
|
||||
import io.jsonwebtoken.security.InvalidKeyException;
|
||||
import io.jsonwebtoken.security.Keys;
|
||||
|
||||
import java.security.Key;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
@ -106,7 +105,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* @param claims the JWT claims to be set as the JWT body.
|
||||
* @return the builder for method chaining.
|
||||
*/
|
||||
JwtBuilder setClaims(Map<String, Object> claims);
|
||||
JwtBuilder setClaims(Map<String, ?> claims);
|
||||
|
||||
/**
|
||||
* Adds all given name/value pairs to the JSON Claims in the payload. If a Claims instance does not yet exist at the
|
||||
|
|
|
@ -17,7 +17,6 @@ package io.jsonwebtoken.impl;
|
|||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.RequiredTypeException;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -27,7 +26,7 @@ public class DefaultClaims extends JwtMap implements Claims {
|
|||
super();
|
||||
}
|
||||
|
||||
public DefaultClaims(Map<String, Object> map) {
|
||||
public DefaultClaims(Map<String, ?> map) {
|
||||
super(map);
|
||||
}
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ public class DefaultJwtBuilder implements JwtBuilder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JwtBuilder setClaims(Map<String, Object> claims) {
|
||||
public JwtBuilder setClaims(Map<String, ?> claims) {
|
||||
this.claims = new DefaultClaims(claims);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ package io.jsonwebtoken.impl;
|
|||
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import io.jsonwebtoken.lang.DateFormats;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
|
@ -34,7 +33,7 @@ public class JwtMap implements Map<String, Object> {
|
|||
this.map = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
public JwtMap(Map<String, Object> map) {
|
||||
public JwtMap(Map<String, ?> map) {
|
||||
this();
|
||||
Assert.notNull(map, "Map argument cannot be null.");
|
||||
putAll(map);
|
||||
|
|
Loading…
Reference in New Issue