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 intDEFAULT_PORT
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Stringcsv(Iterable<?> objects)static Stringexception(Throwable t)Constructs a pretty one line version of aThrowable.static Stringexception(Throwable t, boolean includeLineNumbers)Constructs a pretty one line version of aThrowable.static Stringformat(Iterable<?> objects, String separators)Deprecated.useStringjoin methodsstatic SocketAddressgetAddr(String hostline)Method to transform human readable addresses into usable address objects.static UUIDgetUUID(String uuid)Converts a String to a UUIDstatic Stringhex(int i)Formats an integer as a hex value.static Stringunicode(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.useStringjoin 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)
-
-