Package septogeddon.pluginquery.utils
Class QueryUtil
java.lang.Object
septogeddon.pluginquery.utils.QueryUtil
Utilities that are useful for handling Queries
- Author:
- Thito Yalasatria Sunarya
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
first
(Collection<T> collection) Get the first element of a Collectionstatic void
illegalArgument
(boolean condition, String cause) If the condition is true, throwIllegalArgumentException
static void
illegalState
(boolean condition, String cause) If the condition is true, throwIllegalStateException
static void
If the object is null, throw aNullPointerException
static byte[]
Read the file to memorystatic byte[]
read
(InputStream input) Read the input stream to memory.static void
Throw runtime exceptionstatic String
UUIDtoString
(long mostSigBits, long leastSigBits) Generate UUID to String
-
Constructor Details
-
QueryUtil
public QueryUtil()
-
-
Method Details
-
UUIDtoString
Generate UUID to String- Parameters:
mostSigBits
-leastSigBits
-- Returns:
-
first
Get the first element of a Collection- Type Parameters:
T
-- Parameters:
collection
-- Returns:
- First Element of collection
-
nonNull
If the object is null, throw aNullPointerException
- Parameters:
o
-name
-
-
illegalState
If the condition is true, throwIllegalStateException
- Parameters:
condition
-cause
-
-
illegalArgument
If the condition is true, throwIllegalArgumentException
- Parameters:
condition
-cause
-
-
Throw
Throw runtime exception- Parameters:
t
- the throwable
-
read
Read the input stream to memory. Will close the input.- Parameters:
input
-- Returns:
- Throws:
IOException
-
read
Read the file to memory- Parameters:
file
-- Returns:
- Throws:
IOException
-