Package com.sshtools.common.util
Class GeneralUtil
java.lang.Object
com.sshtools.common.util.GeneralUtil
Other utilities not worth their own class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcolorToString(Color color) Return a string representation of a colorstatic StringencodeHTML(String html) This method will replace 'invalid input: '&'' with "&", '"' with """, 'invalid input: '<'' with "<" and '>' with ">".static StringnumberToPaddedHexString(int number, int size) Convert a number to a zero padded hex stringstatic ColorReturn aColorobject given a string representation of it
-
Constructor Details
-
GeneralUtil
public GeneralUtil()
-
-
Method Details
-
encodeHTML
This method will replace 'invalid input: '&'' with "&", '"' with """, 'invalid input: '<'' with "<" and '>' with ">".- Parameters:
html- html to encode- Returns:
- encoded html
-
stringToColor
Return aColorobject given a string representation of it- Parameters:
color-- Returns:
- string representation
- Throws:
IllegalArgumentException- if string in bad format
-
colorToString
Return a string representation of a color- Parameters:
color-- Returns:
- string representation
-
numberToPaddedHexString
Convert a number to a zero padded hex string- Parameters:
int- number- Returns:
- zero padded hex string
- Throws:
IllegalArgumentException- if number takes up more characters thansize
-