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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tfirst(Collection<T> collection) Get the first element of a Collectionstatic voidillegalArgument(boolean condition, String cause) If the condition is true, throwIllegalArgumentExceptionstatic voidillegalState(boolean condition, String cause) If the condition is true, throwIllegalStateExceptionstatic voidIf the object is null, throw aNullPointerExceptionstatic byte[]Read the file to memorystatic byte[]read(InputStream input) Read the input stream to memory.static voidThrow runtime exceptionstatic StringUUIDtoString(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
-