Package dev.pcvolkmer.mv64e.datamapper
Class ResultSet
- java.lang.Object
-
- dev.pcvolkmer.mv64e.datamapper.ResultSet
-
@NullUnmarked public class ResultSet extends java.lang.ObjectResult set type to wrapMap<String, Object>- Since:
- 0.1
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResultSet(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 booleanequals(java.lang.Object obj)static ResultSetfrom(java.util.Map<java.lang.String,java.lang.Object> rawData)@Nullable java.util.DategetDate(java.lang.String columnName)Get column value as Date and cast value if possible@Nullable java.lang.DoublegetDouble(java.lang.String columnName)Get column value as Double and cast value if possiblejava.lang.IntegergetId()Get the id@Nullable java.lang.IntegergetInteger(java.lang.String columnName)Get column value as Integer and cast value if possible@Nullable java.lang.LonggetLong(java.lang.String columnName)Get column value as Long and cast value if possiblejava.util.List<java.lang.String>getMerkmalList(@NonNull java.lang.String columnName)Get Merkmal values as List of Strings@Nullable java.lang.IntegergetParentId()Get the iddev.pcvolkmer.mv64e.mtb.ReferencegetPatientReference()Get the idjava.util.Map<java.lang.String,java.lang.Object>getRawData()@Nullable java.lang.StringgetString(java.lang.String columnName)Get column value as String and cast value if possibleinthashCode()<T> voidifPropertyNotNull(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> voidifPropertyNotNull(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> voidifValueNotNull(java.lang.String columnName, java.lang.Class<T> clazz, java.util.function.Consumer<T> f)Runs given function if value is not null<T> voidifValueNotNull(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 exceptionbooleanisNull(java.lang.String columnName)Checks if column value has non null valuebooleanisTrue(java.lang.String columnName)Check column value is equal to truevoidrequireAllNotNull(@NonNull java.lang.String... columnNames)Ensures that the values associated with the specified column names are not null.voidrequireNotNull(@NonNull java.lang.String columnName)Ensures that the value associated with the specified column name is not null.
-
-
-
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 columnclazz- The expected column typef- 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 columnclazz- The expected column typef- The function to be used if a value is presente- 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 ofifValueNotNull(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 columnclazz- The expected column typef- 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 ofifValueNotNull(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 columnclazz- The expected column typef- The function to be used if the property is presente- 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 aNullPointerExceptionif 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 tocolumnNameis null.
-
requireAllNotNull
public void requireAllNotNull(@NonNull java.lang.String... columnNames)
Ensures that the values associated with the specified column names are not null. Throws aNullPointerExceptionif 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-