com.atlassian.jira.issue.customfields.converters
Interface UserConverter

All Known Subinterfaces:
MultiUserConverter
All Known Implementing Classes:
MultiUserConverterImpl, UserConverterImpl

@Internal
public interface UserConverter

Converts between User objects and Strings for storage and retrieval of Custom Field values.


Method Summary
 String getDbString(ApplicationUser user)
          Get the String representation of the User to be passed to and from the database tier.
 String getHttpParameterValue(ApplicationUser user)
          Get the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.
 String getString(com.atlassian.crowd.embedded.api.User user)
          Deprecated. Use getHttpParameterValue(ApplicationUser) or getDbString(ApplicationUser) instead. Since v6.0.
 com.atlassian.crowd.embedded.api.User getUser(String stringValue)
          Deprecated. Use getUserFromDbString(String) instead. Since v6.0.
 com.atlassian.crowd.embedded.api.User getUserEvenWhenUnknown(String stringValue)
          Deprecated. Use getUserFromDbString(String) instead. Since v6.0.
 ApplicationUser getUserFromDbString(String stringValue)
          Get the User Object from its database string representation.
 ApplicationUser getUserFromHttpParameterWithValidation(String stringValue)
          Get the User Object from its presentation string representation.
 com.atlassian.crowd.embedded.api.User getUserObject(String stringValue)
          Deprecated. Use getUser(String) instead. Since v5.0.
 

Method Detail

getString

String getString(com.atlassian.crowd.embedded.api.User user)
Deprecated. Use getHttpParameterValue(ApplicationUser) or getDbString(ApplicationUser) instead. Since v6.0.

Get the String representation of the User.

Parameters:
user - the User
Returns:
the String representation of the User

getHttpParameterValue

String getHttpParameterValue(ApplicationUser user)
Get the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.

Parameters:
user - the User
Returns:
the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.
Since:
v6.0

getDbString

String getDbString(ApplicationUser user)
Get the String representation of the User to be passed to and from the database tier.

Parameters:
user - the User
Returns:
the String representation of the User to be passed to and from the database tier.
Since:
v6.0

getUser

com.atlassian.crowd.embedded.api.User getUser(String stringValue)
                                              throws FieldValidationException
Deprecated. Use getUserFromDbString(String) instead. Since v6.0.

Get the User Object from the user name. This will return null if the stringValue is empty.

Parameters:
stringValue - User name
Returns:
A User or null if the input parameter is empty
Throws:
FieldValidationException - if the input parameter is null

getUserEvenWhenUnknown

com.atlassian.crowd.embedded.api.User getUserEvenWhenUnknown(String stringValue)
                                                             throws FieldValidationException
Deprecated. Use getUserFromDbString(String) instead. Since v6.0.

Get the User Object from the user name even when the user is unknown. This is usefull in places where the user needs to be shown, even though they may have disappeared remotely, say from LDAP. This will return null if the stringValue is empty.

Parameters:
stringValue - User name
Returns:
A User or null if the input parameter is empty
Throws:
FieldValidationException - if the input parameter is null
Since:
v4.4.5

getUserFromHttpParameterWithValidation

ApplicationUser getUserFromHttpParameterWithValidation(String stringValue)
                                                       throws FieldValidationException
Get the User Object from its presentation string representation. This will return null if the stringValue is empty.

Parameters:
stringValue - presentation string representation (username)
Returns:
An ApplicationUser (or null if the input parameter is empty)
Throws:
FieldValidationException - if no user exists with the given username
Since:
v6.0
See Also:
#getHttpParameterValue(ApplicationUser)}

getUserFromDbString

ApplicationUser getUserFromDbString(String stringValue)
Get the User Object from its database string representation. If a null stringValue is passed, then a null User object is returned, but it is guaranteed to return a non-null User in all other cases. This is usefull in places where the user needs to be shown, even though they may have disappeared remotely, say from LDAP.

Parameters:
stringValue - database string representation
Returns:
A User or null if the input parameter is empty
Since:
v6.0
See Also:
#getDbString(ApplicationUser)}

getUserObject

com.atlassian.crowd.embedded.api.User getUserObject(String stringValue)
                                                    throws FieldValidationException
Deprecated. Use getUser(String) instead. Since v5.0.

Get the User Object from the user name. This will return null if the stringValue is empty.

Parameters:
stringValue - User name
Returns:
A User or null if the input parameter is empty
Throws:
FieldValidationException - if the input parameter is null


Copyright © 2002-2014 Atlassian. All Rights Reserved.