Class UsernameUtils

java.lang.Object
org.jenkinsci.plugins.builduser.utils.UsernameUtils

public final class UsernameUtils extends Object
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 Details

    • setUsernameVars

      public 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.
      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

      public static String getFirstName(String fullName)
      Extracts the first name from a full name.
      Parameters:
      fullName - The full name string, e.g., "First Last"
      Returns:
      The first name ("First")
    • getLastName

      public static String getLastName(String fullName)
      Extracts the last name from a full name.
      Parameters:
      fullName - The full name string, e.g., "First Last"
      Returns:
      The last name ("Last")