Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatabaseQueryResults

        public DatabaseQueryResults​(T result,
                                    java.lang.Exception exception)
      • DatabaseQueryResults

        public DatabaseQueryResults​(T result)
    • 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.