org.jenkinsci.plugins.builduser.utils
Class UsernameUtils

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

public final class UsernameUtils
extends Object

Utility class for splitting full user name to parts.

Author:
GKonovalenko

Method Summary
static 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setUsernameVars

public static void setUsernameVars(String username,
                                   Map<String,String> variables)
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

public static String getFirstName(String fullName)
Cuts first name (first word) out from the passed string.

Parameters:
fullName - full name -- string like "Chuck Norris"
Returns:
first name ("Chuck")

getLastName

public static String getLastName(String fullName)
Cuts last name (second word) out from the passed string.

Parameters:
fullName - full name -- string like "Chuck Norris"
Returns:
last name ("Norris")


Copyright © 2004-2012. All Rights Reserved.