com.safelayer.rap.json.model.JsonUserInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pki-connector-restapi Show documentation
Show all versions of pki-connector-restapi Show documentation
The PKI Connector RESTAPI is a library that helps developing new PKI Connectors for TrustedX
The newest version!
package com.safelayer.rap.json.model;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.safelayer.rap.api.model.UserInfo;
@SuppressWarnings("serial")
public class JsonUserInfo implements UserInfo, Serializable {
@JsonProperty("sub")
private String id;
@JsonProperty("domain")
private String domain;
private Map attributes;
@JsonIgnore
public JsonUserInfo(String id, String domain, Map attributes) {
this.id = id;
this.domain = domain;
this.attributes = attributes;
}
@JsonIgnore
public JsonUserInfo( UserInfo other ) {
this( other.getId(), other.getDomain(), other.getAttributes() );
}
@JsonCreator
public JsonUserInfo() {
attributes = new HashMap();
}
@JsonIgnore
public String getId() {
return id;
}
@JsonIgnore
public String getDomain() {
return domain;
}
@JsonAnyGetter
public Map getAttributes(){
return attributes;
}
@JsonAnySetter
public void setAttributes( String key, Object value ){
this.attributes.put(key, value);
}
@JsonIgnore
public void setId(String id) {
this.id = id;
}
@JsonIgnore
public void setDomain(String domain) {
this.domain = domain;
}
}