Class ResultSet


  • @NullUnmarked
    public class ResultSet
    extends java.lang.Object
    Result set type to wrap Map<String, Object>
    Since:
    0.1
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ResultSet​(java.util.Map<java.lang.String,​java.lang.Object> rawData)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      static ResultSet from​(java.util.Map<java.lang.String,​java.lang.Object> rawData)  
      @Nullable java.util.Date getDate​(java.lang.String columnName)
      Get column value as Date and cast value if possible
      @Nullable java.lang.Double getDouble​(java.lang.String columnName)
      Get column value as Double and cast value if possible
      java.lang.Integer getId()
      Get the id
      @Nullable java.lang.Integer getInteger​(java.lang.String columnName)
      Get column value as Integer and cast value if possible
      @Nullable java.lang.Long getLong​(java.lang.String columnName)
      Get column value as Long and cast value if possible
      java.util.List<java.lang.String> getMerkmalList​(@NonNull java.lang.String columnName)
      Get Merkmal values as List of Strings
      @Nullable java.lang.Integer getParentId()
      Get the id
      dev.pcvolkmer.mv64e.mtb.Reference getPatientReference()
      Get the id
      java.util.Map<java.lang.String,​java.lang.Object> getRawData()  
      @Nullable java.lang.String getString​(java.lang.String columnName)
      Get column value as String and cast value if possible
      int hashCode()  
      <T> void ifPropertyNotNull​(java.lang.String columnName, java.lang.Class<T> clazz, java.util.function.ObjIntConsumer<T> f)
      Runs given function if property value and property version are not null.
      <T> void ifPropertyNotNull​(java.lang.String columnName, java.lang.Class<T> clazz, java.util.function.ObjIntConsumer<T> f, DataAccessException e)
      Runs given function if property value and property version are not null or throws an exception.
      <T> void ifValueNotNull​(java.lang.String columnName, java.lang.Class<T> clazz, java.util.function.Consumer<T> f)
      Runs given function if value is not null
      <T> void ifValueNotNull​(java.lang.String columnName, java.lang.Class<T> clazz, java.util.function.Consumer<T> f, DataAccessException e)
      Runs given function if value is not null or throws an exception
      boolean isNull​(java.lang.String columnName)
      Checks if column value has non null value
      boolean isTrue​(java.lang.String columnName)
      Check column value is equal to true
      void requireAllNotNull​(@NonNull java.lang.String... columnNames)
      Ensures that the values associated with the specified column names are not null.
      void requireNotNull​(@NonNull java.lang.String columnName)
      Ensures that the value associated with the specified column name is not null.
      • Methods inherited from class java.lang.Object

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

      • ResultSet

        protected ResultSet​(java.util.Map<java.lang.String,​java.lang.Object> rawData)
    • Method Detail

      • from

        public static ResultSet from​(java.util.Map<java.lang.String,​java.lang.Object> rawData)
      • getRawData

        public java.util.Map<java.lang.String,​java.lang.Object> getRawData()
      • getId

        public java.lang.Integer getId()
        Get the id
        Returns:
        The procedures id
      • getParentId

        public @Nullable java.lang.Integer getParentId()
        Get the id
        Returns:
        The procedures id
      • getPatientReference

        public dev.pcvolkmer.mv64e.mtb.Reference getPatientReference()
        Get the id
        Returns:
        The procedures id
      • getString

        public @Nullable java.lang.String getString​(java.lang.String columnName)
        Get column value as String and cast value if possible
        Parameters:
        columnName - The name of the column
        Returns:
        The column value as String
      • getInteger

        public @Nullable java.lang.Integer getInteger​(java.lang.String columnName)
        Get column value as Integer and cast value if possible
        Parameters:
        columnName - The name of the column
        Returns:
        The column value as Integer
      • getLong

        public @Nullable java.lang.Long getLong​(java.lang.String columnName)
        Get column value as Long and cast value if possible
        Parameters:
        columnName - The name of the column
        Returns:
        The column value as Integer
      • getDouble

        public @Nullable java.lang.Double getDouble​(java.lang.String columnName)
        Get column value as Double and cast value if possible
        Parameters:
        columnName - The name of the column
        Returns:
        The column value as Integer
      • getDate

        public @Nullable java.util.Date getDate​(java.lang.String columnName)
        Get column value as Date and cast value if possible
        Parameters:
        columnName - The name of the column
        Returns:
        The column value as Date
      • isTrue

        public boolean isTrue​(java.lang.String columnName)
        Check column value is equal to true
        Parameters:
        columnName - The name of the column
        Returns:
        True if column value is equal to true
      • isNull

        public boolean isNull​(java.lang.String columnName)
        Checks if column value has non null value
        Parameters:
        columnName - The name of the column
        Returns:
        true or false
      • ifValueNotNull

        public <T> void ifValueNotNull​(java.lang.String columnName,
                                       java.lang.Class<T> clazz,
                                       java.util.function.Consumer<T> f)
        Runs given function if value is not null
        Type Parameters:
        T - The type of the given column value
        Parameters:
        columnName - The name of the column
        clazz - The expected column type
        f - The function to be used if a value is present
      • ifValueNotNull

        public <T> void ifValueNotNull​(java.lang.String columnName,
                                       java.lang.Class<T> clazz,
                                       java.util.function.Consumer<T> f,
                                       DataAccessException e)
        Runs given function if value is not null or throws an exception
        Type Parameters:
        T - The type of the given column value
        Parameters:
        columnName - The name of the column
        clazz - The expected column type
        f - The function to be used if a value is present
        e - The exception to be thrown if the value is null
      • ifPropertyNotNull

        public <T> void ifPropertyNotNull​(java.lang.String columnName,
                                          java.lang.Class<T> clazz,
                                          java.util.function.ObjIntConsumer<T> f)
        Runs given function if property value and property version are not null. This is a specialized method of ifValueNotNull(java.lang.String, java.lang.Class<T>, java.util.function.Consumer<T>) for use with property catalogues. A Property is assumed to be a value with a property catalogue version with the column name `..._propcat_version`.
        Type Parameters:
        T - The type of the given column value
        Parameters:
        columnName - The name of the column
        clazz - The expected column type
        f - The function to be used if a property is present
      • ifPropertyNotNull

        public <T> void ifPropertyNotNull​(java.lang.String columnName,
                                          java.lang.Class<T> clazz,
                                          java.util.function.ObjIntConsumer<T> f,
                                          DataAccessException e)
        Runs given function if property value and property version are not null or throws an exception. This is a specialized method of ifValueNotNull(java.lang.String, java.lang.Class<T>, java.util.function.Consumer<T>) for use with property catalogues. A Property is assumed to be a value with a property catalogue version with the column name `..._propcat_version`.
        Type Parameters:
        T - The type of the given column value
        Parameters:
        columnName - The name of the column
        clazz - The expected column type
        f - The function to be used if the property is present
        e - The exception to be thrown if the property is null
      • requireNotNull

        public void requireNotNull​(@NonNull java.lang.String columnName)
        Ensures that the value associated with the specified column name is not null. Throws a NullPointerException if the value is null.
        Parameters:
        columnName - The name of the column whose value should be checked for null. Cannot be null itself.
        Throws:
        java.lang.NullPointerException - if the value corresponding to columnName is null.
      • requireAllNotNull

        public void requireAllNotNull​(@NonNull java.lang.String... columnNames)
        Ensures that the values associated with the specified column names are not null. Throws a NullPointerException if any value is null.
        Parameters:
        columnNames - The names of the columns whose values should be checked for null. Cannot be null itself.
        Throws:
        java.lang.NullPointerException - if any value corresponding to a column name is null.
      • getMerkmalList

        public java.util.List<java.lang.String> getMerkmalList​(@NonNull java.lang.String columnName)
        Get Merkmal values as List of Strings
        Parameters:
        columnName - The name of the column
        Returns:
        The related Merkmal value(s) as List of Strings
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object