Class QueryUtil

java.lang.Object
septogeddon.pluginquery.utils.QueryUtil

public class QueryUtil extends Object
Utilities that are useful for handling Queries
Author:
Thito Yalasatria Sunarya
  • Constructor Details

    • QueryUtil

      public QueryUtil()
  • Method Details

    • UUIDtoString

      public static String UUIDtoString(long mostSigBits, long leastSigBits)
      Generate UUID to String
      Parameters:
      mostSigBits -
      leastSigBits -
      Returns:
    • first

      public static <T> T first(Collection<T> collection)
      Get the first element of a Collection
      Type Parameters:
      T -
      Parameters:
      collection -
      Returns:
      First Element of collection
    • nonNull

      public static void nonNull(Object o, String name)
      If the object is null, throw a NullPointerException
      Parameters:
      o -
      name -
    • illegalState

      public static void illegalState(boolean condition, String cause)
      If the condition is true, throw IllegalStateException
      Parameters:
      condition -
      cause -
    • illegalArgument

      public static void illegalArgument(boolean condition, String cause)
      If the condition is true, throw IllegalArgumentException
      Parameters:
      condition -
      cause -
    • Throw

      public static void Throw(Throwable t)
      Throw runtime exception
      Parameters:
      t - the throwable
    • read

      public static byte[] read(InputStream input) throws IOException
      Read the input stream to memory. Will close the input.
      Parameters:
      input -
      Returns:
      Throws:
      IOException
    • read

      public static byte[] read(File file) throws IOException
      Read the file to memory
      Parameters:
      file -
      Returns:
      Throws:
      IOException