Class UsernameUtils
java.lang.Object
org.jenkinsci.plugins.builduser.utils.UsernameUtils
Utility class for manipulating and extracting parts from a full username.
This class provides methods to split a full username into first and last names.
- Author:
- GKonovalenko
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFirstName
(String fullName) Extracts the first name from a full name.static String
getLastName
(String fullName) Extracts the last name from a full name.static void
setUsernameVars
(String username, Map<String, String> variables) Splits a full username string into first and last names and sets the appropriate build variables.
-
Method Details
-
setUsernameVars
Splits a full username string into first and last names and sets the appropriate build variables.- Parameters:
username
- The full username string, usually in the format "First Last"variables
- A map to store the extracted variables, where to put build variables.
-
getFirstName
Extracts the first name from a full name.- Parameters:
fullName
- The full name string, e.g., "First Last"- Returns:
- The first name ("First")
-
getLastName
Extracts the last name from a full name.- Parameters:
fullName
- The full name string, e.g., "First Last"- Returns:
- The last name ("Last")
-