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 String
colorToString
(Color color) Return a string representation of a colorstatic String
encodeHTML
(String html) This method will replace '&' with "&", '"' with """, '<' with "<" and '>' with ">".static String
numberToPaddedHexString
(int number, int size) Convert a number to a zero padded hex stringstatic Color
Return aColor
object given a string representation of it
-
Constructor Details
-
GeneralUtil
public GeneralUtil()
-
-
Method Details
-
encodeHTML
This method will replace '&' with "&", '"' with """, '<' with "<" and '>' with ">".- Parameters:
html
- html to encode- Returns:
- encoded html
-
stringToColor
Return aColor
object 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
-