|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.tools.workbench.base.WorkbenchUtilities
This class provides some utilities to the Workbench
Field Summary | |
protected static long |
counter
Counter for the current VM |
static int |
counterDigits
Number of digits for the counter |
protected static java.lang.String |
encryptionAlgorithm
Default encryption algorithm |
static boolean |
includeIP
Should include the IP computer address |
static boolean |
includeTime
Should include the time |
protected static java.security.MessageDigest |
messageDigest
Message Digest to make the code secure |
static int |
randomDigits
Number of digits for the random number |
protected static java.lang.String |
UNKNOW_IP
Default IP computer address, if can't get one |
Constructor Summary | |
WorkbenchUtilities()
Constructs a WorkbenchUtility Object |
Method Summary | |
static java.lang.String |
getHexLocalHost()
This method returns the local host IP address in hexadecimal and without separators. |
static java.lang.String |
getHexRandom(int digits)
This method returns a random number of digits length. |
static java.lang.String |
getSecureUniqueCode()
This method returns an unique code. |
static java.lang.String |
getSecureUniqueCode(java.lang.String userString)
This method returns an unique code. |
static java.sql.Timestamp |
getTimestamp()
This method returns the current timestamp |
static java.lang.String |
getUniqueCode()
This method returns an unique code. |
static java.lang.String |
getUniqueCode(java.lang.String userString)
This method returns an unique code and appends it a String provided by the user |
static java.lang.String |
lpad(java.lang.String text,
int columns,
char ch)
This method aligns a string to the left with columns size and ch chars. |
static java.lang.String |
replace(java.lang.String text,
java.lang.String key,
java.lang.String value)
This method replace all the occurrences of the key by the specified value |
static java.lang.String |
rpad(java.lang.String text,
int columns,
char ch)
This method aligns a string to the right with columns size and ch chars. |
protected static void |
setCounterDigits(int counterDig)
Sets the number of digits for the counter. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static boolean includeIP
public static boolean includeTime
public static int counterDigits
public static int randomDigits
protected static long counter
protected static java.lang.String UNKNOW_IP
protected static java.security.MessageDigest messageDigest
protected static java.lang.String encryptionAlgorithm
Constructor Detail |
public WorkbenchUtilities()
Method Detail |
public static java.lang.String getHexLocalHost()
public static java.lang.String getHexRandom(int digits)
digits
- int the number of digitspublic static java.lang.String getSecureUniqueCode()
public static java.lang.String getSecureUniqueCode(java.lang.String userString)
userString
- java.lang.Stringpublic static java.sql.Timestamp getTimestamp()
public static java.lang.String getUniqueCode()
public static java.lang.String getUniqueCode(java.lang.String userString)
userString
- java.lang.String The String provided by the user to be added to the generated codepublic static java.lang.String lpad(java.lang.String text, int columns, char ch)
text
- java.lang.String the String to be alignedcolumns
- int the number of columnsch
- char the char used to alignpublic static java.lang.String replace(java.lang.String text, java.lang.String key, java.lang.String value)
text
- java.lang.String The String to be processedkey
- java.lang.String The key to be replacedvalue
- java.lang.String The value to replace the keypublic static java.lang.String rpad(java.lang.String text, int columns, char ch)
text
- java.lang.String The String to be alignedcolumns
- int The number of columnsch
- char The char user to alignprotected static void setCounterDigits(int counterDig)
counterDig
- int The number of digits used by the counter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |