com.atlassian.crowd.util
Class PrincipalUtils

java.lang.Object
  extended by com.atlassian.crowd.util.PrincipalUtils

public class PrincipalUtils
extends java.lang.Object

General utility class for email related methods.


Field Summary
static java.lang.String EMAIL_REGEX
           
 
Constructor Summary
PrincipalUtils()
           
 
Method Summary
static java.lang.String[] getFirstNameLastName(java.lang.String fullname)
          Splits the first name and last name out from a full name string.
static boolean isValidEmail(java.lang.String email)
          Returns true if an email address is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMAIL_REGEX

public static final java.lang.String EMAIL_REGEX
See Also:
Constant Field Values
Constructor Detail

PrincipalUtils

public PrincipalUtils()
Method Detail

isValidEmail

public static boolean isValidEmail(java.lang.String email)
Returns true if an email address is valid.

Parameters:
email - potential email address.
Returns:
true if an email address is valid.

getFirstNameLastName

public static java.lang.String[] getFirstNameLastName(java.lang.String fullname)
Splits the first name and last name out from a full name string. The first name is formed by the characters prior to the first space in the string, the last name is formed by characters after the space. This method will always return an array of size 2, with each element being non-null.

Parameters:
fullname - the fullname to parse.
Returns:
String[0] = firstname, String[1] = lastname.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.