Class UsernameUtils
java.lang.Object
org.jenkinsci.plugins.builduser.utils.UsernameUtils
Utility class for splitting full user name to parts.
- Author:
- GKonovalenko
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFirstName
(String fullName) Cuts first name (first word) out from the passed string.static String
getLastName
(String fullName) Cuts last name (second word) out from the passed string.static void
setUsernameVars
(String username, Map<String, String> variables) Splits username string to first & last names and sets appropriate build variables.
-
Method Details
-
setUsernameVars
Splits username string to first & last names and sets appropriate build variables.- Parameters:
username
- string with username, usually smth. like "Chuck Norris"variables
- result map, where to put build variables.
-
getFirstName
Cuts first name (first word) out from the passed string.- Parameters:
fullName
- full name -- string like "Chuck Norris"- Returns:
- first name ("Chuck")
-
getLastName
Cuts last name (second word) out from the passed string.- Parameters:
fullName
- full name -- string like "Chuck Norris"- Returns:
- last name ("Norris")
-