Package org.sakaiproject.unboundid
Class StringUserTypeMapper
- java.lang.Object
-
- org.sakaiproject.unboundid.StringUserTypeMapper
-
- All Implemented Interfaces:
UserTypeMapper
- Direct Known Subclasses:
EmptyStringUserTypeMapper
public class StringUserTypeMapper extends Object implements UserTypeMapper
Very simpleUserTypeMapperwhich generates the sameStringvalue for any users. Technically, this object could be reconfigured at any time.- Author:
- dmccallum
-
-
Constructor Summary
Constructors Constructor Description StringUserTypeMapper()Leaves the cached user typeStringinitialized tonullStringUserTypeMapper(String userType)Sets the cached user type to the givenString.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetUserType()Access the user typeStringto be returned from any invocation ofmapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper).StringmapLdapEntryToSakaiUserType(com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPEntry ldapEntry, LdapAttributeMapper mapper)Always returns the value set bysetUserType(String).voidsetUserType(String userType)Set the user typeStringto be returned from any invocation ofmapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper).
-
-
-
Constructor Detail
-
StringUserTypeMapper
public StringUserTypeMapper()
Leaves the cached user typeStringinitialized tonull
-
StringUserTypeMapper
public StringUserTypeMapper(String userType)
Sets the cached user type to the givenString. Effectively the same as using the no-arg constructor, then invokingsetUserType(String). No guarantees exist that this constructor will actually invoke that method, though.- Parameters:
userType- a user type String.nulland empty Strings OK
-
-
Method Detail
-
mapLdapEntryToSakaiUserType
public String mapLdapEntryToSakaiUserType(com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPEntry ldapEntry, LdapAttributeMapper mapper)
Always returns the value set bysetUserType(String). Default isnull- Specified by:
mapLdapEntryToSakaiUserTypein interfaceUserTypeMapper- Parameters:
ldapEntry- a user'sLDAPEntry, should not benullmapper- encapsulates mapping configuration- Returns:
- the value cached by
setUserType(String).
-
getUserType
public String getUserType()
Access the user typeStringto be returned from any invocation ofmapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper).- Returns:
- the cached user type
String. Might benullor empty.
-
setUserType
public void setUserType(String userType)
Set the user typeStringto be returned from any invocation ofmapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper).- Parameters:
userType- a user type String.nulland empty Strings OK
-
-