Package i5.las2peer.tools
Class SimpleTools
java.lang.Object
i5.las2peer.tools.SimpleTools
Collection of simple tools not large enough to form a separate class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringset with available characters for random string generation viacreateRandomString(int) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbyteToHexString(byte[] bytes) static StringcreateRandomString(int length) create a random string of the given length with the possible characters fromsRandomStringCharSetstatic intstatic Stringa simple join method to concatenate String representations of the given objectsstatic Stringa simple join method to concatenate String representations of the given objectsstatic longGets a long hash value from a given Stringstatic Stringrepeat the string representation of the given object count timesstatic Stringrepeat a String count timesstatic byte[]
-
Field Details
-
sRandomStringCharSet
set with available characters for random string generation viacreateRandomString(int)- See Also:
-
-
Constructor Details
-
SimpleTools
public SimpleTools()
-
-
Method Details
-
longHash
Gets a long hash value from a given String- Parameters:
s-- Returns:
- Returns the hash as long number
-
createRandomString
create a random string of the given length with the possible characters fromsRandomStringCharSet- Parameters:
length-- Returns:
- a random string
-
join
a simple join method to concatenate String representations of the given objects- Parameters:
objects-glue-- Returns:
- join string
-
join
a simple join method to concatenate String representations of the given objects- Parameters:
objects-glue-- Returns:
- join string
-
repeat
repeat a String count times- Parameters:
string-count-- Returns:
- concatenated string
-
repeat
repeat the string representation of the given object count times- Parameters:
o-count-- Returns:
- concatenated string
-
toByteArray
- Throws:
IOException
-
byteToHexString
-
getSystemDefinedPort
public static int getSystemDefinedPort()
-