Class UserProfile
java.lang.Object
org.forgerock.openig.tools.userprofile.UserProfile
Class containing user profile information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the raw JSON representation as aJsonValue.Get the common name (cn) ornullif none.Get the user's distinguished name (dn) ornullif none.getRealm()Get the user's realm ornullif none.Get the user's username.rawInfo()Returns the unmodifiableMapof the user profile info, notnull.static StringUtility method to unwrap a profile attribute that is wrapped in a JSON array.
-
Constructor Details
-
UserProfile
Constructor taking the rawJsonValue. Note that this does not raise an error if the profile is empty.- Parameters:
rawInfo- raw user profile data
-
-
Method Details
-
unwrap
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
Get the user's username.- Returns:
- the username
-
getRealm
Get the user's realm ornullif none.- Returns:
- the realm or
nullif none.
-
getDistinguishedName
Get the user's distinguished name (dn) ornullif none.- Returns:
- the distinguished name (dn) or
nullif none.
-
getCommonName
Get the common name (cn) ornullif none.- Returns:
- the common name (cn) or
nullif none.
-
rawInfo
Returns the unmodifiableMapof the user profile info, notnull.- Returns:
- the unmodifiable
Mapof the user profile info, notnull
-
asRawJson
Get the raw JSON representation as aJsonValue. This is not null and will contain the Access Management user profile object structure. It could hypothetically be empty and values may be null, depending on the fields requested.- Returns:
- the JSON representation.
-