Package com.sshtools.common.util
Class GeneralUtil
- java.lang.Object
-
- com.sshtools.common.util.GeneralUtil
-
public final class GeneralUtil extends java.lang.Object
Other utilities not worth their own class
-
-
Constructor Summary
Constructors Constructor Description GeneralUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
colorToString(java.awt.Color color)
Return a string representation of a colorstatic java.lang.String
encodeHTML(java.lang.String html)
This method will replace '&' with "&", '"' with """, '<' with "<" and '>' with ">".static java.lang.String
numberToPaddedHexString(int number, int size)
Convert a number to a zero padded hex stringstatic java.awt.Color
stringToColor(java.lang.String s)
Return aColor
object given a string representation of it
-
-
-
Method Detail
-
encodeHTML
public static java.lang.String encodeHTML(java.lang.String html)
This method will replace '&' with "&", '"' with """, '<' with "<" and '>' with ">".- Parameters:
html
- html to encode- Returns:
- encoded html
-
stringToColor
public static java.awt.Color stringToColor(java.lang.String s)
Return aColor
object given a string representation of it- Parameters:
color
-- Returns:
- string representation
- Throws:
java.lang.IllegalArgumentException
- if string in bad format
-
colorToString
public static java.lang.String colorToString(java.awt.Color color)
Return a string representation of a color- Parameters:
color
-- Returns:
- string representation
-
numberToPaddedHexString
public static java.lang.String numberToPaddedHexString(int number, int size)
Convert a number to a zero padded hex string- Parameters:
int
- number- Returns:
- zero padded hex string
- Throws:
java.lang.IllegalArgumentException
- if number takes up more characters thansize
-
-