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 JsonValue
asRawJson()
Get the raw JSON representation as aJsonValue
.String
getCommonName()
Get the common name (cn) ornull
if none.String
getDistinguishedName()
Get the user's distinguished name (dn) ornull
if none.String
getRealm()
Get the user's realm ornull
if none.String
getUsername()
Get the user's username.Map<String,Object>
rawInfo()
Returns the unmodifiableMap
of the user profile info, notnull
.static String
unwrap(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 ornull
if none.- Returns:
- the realm or
null
if none.
-
getDistinguishedName
public String getDistinguishedName()
Get the user's distinguished name (dn) ornull
if none.- Returns:
- the distinguished name (dn) or
null
if none.
-
getCommonName
public String getCommonName()
Get the common name (cn) ornull
if none.- Returns:
- the common name (cn) or
null
if none.
-
rawInfo
public Map<String,Object> rawInfo()
Returns the unmodifiableMap
of the user profile info, notnull
.- Returns:
- the unmodifiable
Map
of the user profile info, notnull
.
-
-