Class UserProfile
- java.lang.Object
-
- org.forgerock.openig.tools.userprofile.UserProfile
-
public class UserProfile extends Object
Class containing user profile information.
-
-
Constructor Summary
Constructors Constructor Description UserProfile(JsonValue rawInfo)Constructor taking the rawJsonValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonValueasRawJson()Get the raw JSON representation as aJsonValue.StringgetCommonName()Get the common name (cn) ornullif none.StringgetDistinguishedName()Get the user's distinguished name (dn) ornullif none.StringgetRealm()Get the user's realm ornullif none.StringgetUsername()Get the user's username.Map<String,Object>rawInfo()Returns the unmodifiableMapof the user profile info, notnull.static Stringunwrap(JsonValue config, String key)Utility method to unwrap a profile attribute that is wrapped in a JSON array.
-
-
-
Method Detail
-
unwrap
public static String unwrap(JsonValue config, String key)
Utility method to unwrap a profile attribute that is wrapped in a JSON array. Example:{ "cn": [ "foo" ] } ==> foo- Parameters:
config- The JsonValue node holding the datakey- The attribute that holds the multivalued data as an array- Returns:
- The first value of that the multivalued data, or null if none.
-
getUsername
public String getUsername()
Get the user's username.- Returns:
- the username
-
getRealm
public String getRealm()
Get the user's realm ornullif none.- Returns:
- the realm or
nullif none.
-
getDistinguishedName
public String getDistinguishedName()
Get the user's distinguished name (dn) ornullif none.- Returns:
- the distinguished name (dn) or
nullif none.
-
getCommonName
public String getCommonName()
Get the common name (cn) ornullif none.- Returns:
- the common name (cn) or
nullif none.
-
rawInfo
public Map<String,Object> rawInfo()
Returns the unmodifiableMapof the user profile info, notnull.- Returns:
- the unmodifiable
Mapof the user profile info, notnull.
-
-