All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.safelayer.rap.json.model.JsonUserInfo Maven / Gradle / Ivy

Go to download

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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy