/*
 * oxTrust is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */

package org.gluu.oxauth.client.auth.user;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * User profile retrieved from oxAuth after successful authentication
 * 
 * @author Yuriy Movchan 11/14/2014
 */
public class UserProfile implements Serializable {

	private static final long serialVersionUID = 4570636703916315314L;

	private String id;

	private final Map<String, Object> attributes = new HashMap<String, Object>();

	public String getId() {
		return id;
	}

	public void setId(final String id) {
		this.id = id;
	}

	public Map<String, Object> getAttributes() {
		return Collections.unmodifiableMap(this.attributes);
	}

	public Object getAttribute(final String name) {
		return this.attributes.get(name);
	}

	public void addAttribute(final String key, final Object value) {
		if (value != null) {
			this.attributes.put(key, value);
		}
	}

}

@@ -1058,10 +1058,233 @@
 %09%09%7D%0A%09%7D%0A%0A
+%09@Override%0A%09public String toString() %7B%0A%09%09StringBuilder builder = new StringBuilder();%0A%09%09builder.append(%22UserProfile %5Bid=%22).append(id).append(%22, attributes=%22).append(attributes).append(%22%5D%22);%0A%09%09return builder.toString();%0A%09%7D%0A%0A
 %7D%0A

Add toString to dump profile attributes