public class Utilities
extends java.lang.Object
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
static byte |
binStringToByte(java.lang.String binString)
binStringToByte: this method convert a binary string in format 0bdddddddd to byte
I need convert first to integer because Java don't have unsigned bytes.
|
static java.lang.String |
CleanString(java.lang.String msg) |
static ServerStatus |
getConfig(ServerStatus server)
getConfig: this method read the configuration file.
|
static ServerStatus |
getRules(ServerStatus server)
getRules: this method read the rules configuration file.
|
static byte |
hexStringToByte(java.lang.String hexString)
hexStringToByte: this method convert a hexadecimal string in format 0xHH to byte
I need convert first to integer because Java don't have unsigned bytes.
|
static java.lang.String |
left(java.lang.String str,
int size)
left: this method return the 'size' chars positioned on the left of the string
|
static java.lang.String |
mid(java.lang.String str,
int pos,
int size)
mid: this method return the 'size' chars, from position 'pos'.
|
static java.lang.String |
right(java.lang.String str,
int size)
right: this method return the 'size' chars positioned on the right of the string
|
static void |
welcome(Server server)
welcome: this method shows the welcome message
|
public static java.lang.String CleanString(java.lang.String msg)
public static void welcome(Server server)
server
- to show the welcome message.public static ServerStatus getConfig(ServerStatus server)
server
- Object Server with the statuspublic static ServerStatus getRules(ServerStatus server)
server:
- server who store the rules.public static byte hexStringToByte(java.lang.String hexString)
hexString:
- Hexadecimal string to convert to byte.public static byte binStringToByte(java.lang.String binString)
binString:
- binary string to convert to byte.public static java.lang.String right(java.lang.String str, int size)
str
- String to get the n characters positioned on the right.size
- Number of chars to get.public static java.lang.String left(java.lang.String str, int size)
str
- String to get the n characters positioned on the left.size
- Number of chars to get.public static java.lang.String mid(java.lang.String str, int pos, int size)
str
- String to get the n characters positioned on the left.pos
- Position to begin to get the chars.size
- Number of chars to get.