Class UserConverterImpl
java.lang.Object
com.atlassian.jira.issue.customfields.converters.UserConverterImpl
- All Implemented Interfaces:
UserConverter
- Direct Known Subclasses:
MultiUserConverterImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDbString
(ApplicationUser user) Get the String representation of the User to be passed to and from the database tier.Get the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.getString
(ApplicationUser user) Get the String representation of the User.Get the User Object from the user name.getUserEvenWhenUnknown
(String stringValue) Get the User Object from the user name even when the user is unknown.getUserFromDbString
(String stringValue) Get the User Object from its database string representation.getUserFromHttpParameterWithValidation
(String stringValue) Get the User Object from its presentation string representation.getUserObject
(String stringValue) Get the User Object from the user name.
-
Constructor Details
-
UserConverterImpl
-
-
Method Details
-
getString
Description copied from interface:UserConverter
Get the String representation of the User.- Specified by:
getString
in interfaceUserConverter
- Parameters:
user
- the User- Returns:
- the String representation of the User
-
getHttpParameterValue
Description copied from interface:UserConverter
Get the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.- Specified by:
getHttpParameterValue
in interfaceUserConverter
- Parameters:
user
- the User- Returns:
- the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.
-
getDbString
Description copied from interface:UserConverter
Get the String representation of the User to be passed to and from the database tier.- Specified by:
getDbString
in interfaceUserConverter
- Parameters:
user
- the User- Returns:
- the String representation of the User to be passed to and from the database tier.
-
getUser
Description copied from interface:UserConverter
Get the User Object from the user name. This will return null if the stringValue is empty.- Specified by:
getUser
in interfaceUserConverter
- Parameters:
stringValue
- User name- Returns:
- A User or null if the input parameter is empty
- Throws:
FieldValidationException
- if the input parameter is null
-
getUserEvenWhenUnknown
Description copied from interface:UserConverter
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.- Specified by:
getUserEvenWhenUnknown
in interfaceUserConverter
- Parameters:
stringValue
- User name- Returns:
- A User or null if the input parameter is empty
- Throws:
FieldValidationException
- if the input parameter is null
-
getUserFromHttpParameterWithValidation
public ApplicationUser getUserFromHttpParameterWithValidation(String stringValue) throws FieldValidationException Description copied from interface:UserConverter
Get the User Object from its presentation string representation. This will return null if the stringValue is empty.- Specified by:
getUserFromHttpParameterWithValidation
in interfaceUserConverter
- 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
-
getUserFromDbString
Description copied from interface:UserConverter
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.- Specified by:
getUserFromDbString
in interfaceUserConverter
- Parameters:
stringValue
- database string representation- Returns:
- A User or null if the input parameter is empty
-
getUserObject
Description copied from interface:UserConverter
Get the User Object from the user name. This will return null if the stringValue is empty.- Specified by:
getUserObject
in interfaceUserConverter
- Parameters:
stringValue
- User name- Returns:
- A User or null if the input parameter is empty
- Throws:
FieldValidationException
- if the input parameter is null
-