ca.bc.gov.webade
Class WebADEUtils

java.lang.Object
  extended byca.bc.gov.webade.WebADEUtils

public final class WebADEUtils
extends java.lang.Object

Author:
jross

Field Summary
static java.lang.String BACKSLASH
          Helper constant for the '\' character.
static java.lang.String DEFAULT_ENCODING
          The default encoding scheme for URL encoding and decoding.
static java.lang.String FORWARDSLASH
          Helper constant for the '/' character.
 
Constructor Summary
WebADEUtils()
           
 
Method Summary
static boolean areEqual(java.util.Date value1, java.util.Date value2)
          Compares two dates, returning true if they are both null, or are equivalent dates.
static boolean areEqual(java.lang.Object value1, java.lang.Object value2)
          Compares two objects, returning true if they are both null, or the equals() Object method returns true.
static boolean areEqual(java.lang.String value1, java.lang.String value2)
          Compares two strings, returning true if they are both null, or are equivalent strings.
static java.lang.String convertBackSlashesToForward(java.lang.String value)
          Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method convertBackSlashesToForward() instead.
static java.lang.String convertForwardSlashesToBack(java.lang.String value)
          Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method convertForwardSlashesToBack() instead.
static java.lang.String convertGUIDFormat(java.lang.String guid)
          Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method convertGUIDFormat() instead.
static java.lang.String extractAccountName(java.lang.String userId)
          Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method extractAccountName() instead.
static java.lang.String extractSourceDirectory(java.lang.String userId)
          Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method extractSourceDirectory() instead.
static java.lang.String getWebADEVersion()
           
static boolean isBlankOrNull(java.lang.String stringValue)
          Checks to see if the given string value is an empty string or a null value.
static boolean isInIntegerArray(java.lang.Integer i, java.lang.Integer[] ia)
          Looks for the given Integer in the array.
static boolean isInStringArray(java.lang.String s, java.lang.String[] sa)
          Looks for the given String in the array.
static java.lang.String stripNonNumericCharacters(java.lang.String inputString)
          Strips all non-numeric characters from the given String, returning only the numeric string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final java.lang.String DEFAULT_ENCODING
The default encoding scheme for URL encoding and decoding.

See Also:
Constant Field Values

BACKSLASH

public static final java.lang.String BACKSLASH
Helper constant for the '\' character.

See Also:
Constant Field Values

FORWARDSLASH

public static final java.lang.String FORWARDSLASH
Helper constant for the '/' character.

See Also:
Constant Field Values
Constructor Detail

WebADEUtils

public WebADEUtils()
Method Detail

getWebADEVersion

public static final java.lang.String getWebADEVersion()
Returns:
The version of this WebADE library in the format 00_00_00.

convertGUIDFormat

public static final java.lang.String convertGUIDFormat(java.lang.String guid)
Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method convertGUIDFormat() instead.

Converts the given GUID between native GUID and Microsoft GUID and returns the result. For example: 00D26B7C1AECEE4F8B8353B74D2E5BA5 to 7C6BD200EC1A4FEE8B8353B74D2E5BA5

Parameters:
guid - The guid to convert.
Returns:
The converted guid.

convertBackSlashesToForward

public static final java.lang.String convertBackSlashesToForward(java.lang.String value)
Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method convertBackSlashesToForward() instead.

Converts '\' characters to '/' characters in the given string and returns the result.

Parameters:
value - The value to convert.
Returns:
The converted string.

convertForwardSlashesToBack

public static final java.lang.String convertForwardSlashesToBack(java.lang.String value)
Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method convertForwardSlashesToBack() instead.

Converts '/' characters to '\' characters in the given string and returns the result.

Parameters:
value - The value to convert.
Returns:
The converted string.

isInStringArray

public static final boolean isInStringArray(java.lang.String s,
                                            java.lang.String[] sa)
Looks for the given String in the array.

Parameters:
s - The target String.
sa - The String array.
Returns:
true if the string s is in the String array sa

isInIntegerArray

public static final boolean isInIntegerArray(java.lang.Integer i,
                                             java.lang.Integer[] ia)
Looks for the given Integer in the array.

Parameters:
i - The target Integer.
ia - The Integer array.
Returns:
true if the integer i is in the String array ia

extractAccountName

public static final java.lang.String extractAccountName(java.lang.String userId)
Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method extractAccountName() instead.

Extracts a user's account name from a "domain/user" format.

Parameters:
userId - The user's fully-qualified id.
Returns:
The user's account name.

extractSourceDirectory

public static final java.lang.String extractSourceDirectory(java.lang.String userId)
Deprecated. Use ca.bc.gov.webade.user.WebADEUserUtils method extractSourceDirectory() instead.

Extracts a user's source directory, or domain, from a "domain/user" format.

Parameters:
userId - The user's fully-qualified id.
Returns:
The user's source directory.

stripNonNumericCharacters

public static final java.lang.String stripNonNumericCharacters(java.lang.String inputString)
Strips all non-numeric characters from the given String, returning only the numeric string.

Parameters:
inputString -
Returns:
The given string without non-numeric characters.

isBlankOrNull

public static boolean isBlankOrNull(java.lang.String stringValue)
Checks to see if the given string value is an empty string or a null value.

Parameters:
stringValue - The string to test.
Returns:
True if the given string is blank or null.

areEqual

public static boolean areEqual(java.lang.String value1,
                               java.lang.String value2)
Compares two strings, returning true if they are both null, or are equivalent strings.

Parameters:
value1 - The first string to compare.
value2 - The second string to compare.
Returns:
True if the strings are equal.

areEqual

public static boolean areEqual(java.util.Date value1,
                               java.util.Date value2)
Compares two dates, returning true if they are both null, or are equivalent dates.

Parameters:
value1 - The first date to compare.
value2 - The second date to compare.
Returns:
True if the dates are equal.

areEqual

public static boolean areEqual(java.lang.Object value1,
                               java.lang.Object value2)
Compares two objects, returning true if they are both null, or the equals() Object method returns true.

Parameters:
value1 - The first object to compare.
value2 - The second object to compare.
Returns:
True if the objects are equal.