Package net.md_5.bungee
Class Util
- java.lang.Object
-
- net.md_5.bungee.Util
-
public class Util extends Object
Series of utility classes to perform various operations.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
csv(Iterable<?> objects)
static String
exception(Throwable t)
Constructs a pretty one line version of aThrowable
.static String
exception(Throwable t, boolean includeLineNumbers)
Constructs a pretty one line version of aThrowable
.static String
format(Iterable<?> objects, String separators)
Deprecated.useString
join methodsstatic SocketAddress
getAddr(String hostline)
Method to transform human readable addresses into usable address objects.static UUID
getUUID(String uuid)
Converts a String to a UUIDstatic String
hex(int i)
Formats an integer as a hex value.static String
unicode(char c)
Formats an char as a unicode value.
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAddr
public static SocketAddress getAddr(String hostline)
Method to transform human readable addresses into usable address objects.- Parameters:
hostline
- in the format of 'host:port'- Returns:
- the constructed hostname + port.
-
hex
public static String hex(int i)
Formats an integer as a hex value.- Parameters:
i
- the integer to format- Returns:
- the hex representation of the integer
-
unicode
public static String unicode(char c)
Formats an char as a unicode value.- Parameters:
c
- the character to format- Returns:
- the unicode representation of the character
-
exception
public static String exception(Throwable t)
Constructs a pretty one line version of aThrowable
. Useful for debugging.
-
exception
public static String exception(Throwable t, boolean includeLineNumbers)
Constructs a pretty one line version of aThrowable
. Useful for debugging.
-
format
@Deprecated public static String format(Iterable<?> objects, String separators)
Deprecated.useString
join methodsReturns a string of objects, each separated by a separator.- Parameters:
objects
- the objects to joinseparators
- the separator- Returns:
- joined string
- See Also:
String.join(java.lang.CharSequence, java.lang.Iterable)
-
-