Class DatabaseQueryResults<T>
- java.lang.Object
-
- com.cmput301w23t09.qrhunter.database.DatabaseQueryResults<T>
-
- Type Parameters:
T
- The type of the data results
public class DatabaseQueryResults<T> extends java.lang.Object
Database query result helper class used as an intermediate between the database and application in data representation.
-
-
Constructor Summary
Constructors Constructor Description DatabaseQueryResults(T result)
DatabaseQueryResults(T result, java.lang.Exception exception)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getData()
Retrieve the result of the database query.java.lang.Exception
getException()
Retrieve the exception of the database query if any.boolean
isSuccessful()
Check if the database query was successful.
-
-
-
Method Detail
-
isSuccessful
public boolean isSuccessful()
Check if the database query was successful.- Returns:
- if the database query was successful
-
getData
public T getData()
Retrieve the result of the database query.- Returns:
- database results
- Throws:
java.lang.IllegalStateException
- if database query was not successful
-
getException
public java.lang.Exception getException()
Retrieve the exception of the database query if any.- Returns:
- exception or null if no exception was found.
-
-