Class Util

java.lang.Object
net.md_5.bungee.Util

public class Util extends Object
Series of utility classes to perform various operations.
  • Field Details

  • Constructor Details

    • Util

      public Util()
  • Method Details

    • 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 a Throwable. Useful for debugging.
      Parameters:
      t - the Throwable to format.
      Returns:
      a string representing information about the Throwable
    • exception

      public static String exception(Throwable t, boolean includeLineNumbers)
      Constructs a pretty one line version of a Throwable. Useful for debugging.
      Parameters:
      t - the Throwable to format.
      includeLineNumbers - whether to include line numbers
      Returns:
      a string representing information about the Throwable
    • csv

      public static String csv(Iterable<?> objects)
    • format

      @Deprecated public static String format(Iterable<?> objects, String separators)
      Deprecated.
      use String join methods
      Returns a string of objects, each separated by a separator.
      Parameters:
      objects - the objects to join
      separators - the separator
      Returns:
      joined string
      See Also:
    • getUUID

      public static UUID getUUID(String uuid)
      Converts a String to a UUID
      Parameters:
      uuid - The string to be converted
      Returns:
      The result