SelectionResult
| Type | 🔵 Class |
| Package | io.github.mrtesz.teszcore.db.selection |
| GitHub | SelectionResult.java |
| Implements | Copyable<SelectionResult> |
Description
Class for simple handling of a single table row Represents a Map<columnName, value> e.g.
| Key | Value |
|---|---|
| username | Mr_Tesz |
| mrtesz@example.com |
Constructor
SelectionResult(Map<String, Object> result);
| Parameter | Type | Annotations | Description |
|---|---|---|---|
result | Map<String, Object> | @NotNull | Map representing a row (see #Description |
Methods
get
Object get(String columnName);
Object get(@NotNull String columnName, Object def);
Get the value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | Object | - | (optional) Returned if the column has no value in this row |
Returns: Object — the value of the provided column name in the represented row
getString
String getString(@NotNull String columnName) throws DatabaseException;
String getString(@NotNull String columnName, String def);
Get the String value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | String | - | (optional) Returned if the column has no value in this row |
Returns: String — the value of the provided column name in this row
getInt
Integer getInt(@NotNull String columnName) throws DatabaseException;
Integer getInt(@NotNull String columnName, Integer def);
Get the Integer value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | Integer | - | (optional) Returned if the column has no value in this row |
Returns: Integer — the value of the provided column name in this row
getLong
Long getLong(@NotNull String columnName) throws DatabaseException;
Long getLong(@NotNull String columnName, Long def);
Get the Long value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | Long | - | (optional) Returned if the column has no value in this row |
Returns: Long — the value of the provided column name in this row
getDouble
Double getDouble(@NotNull String columnName) throws DatabaseException;
Double getDouble(@NotNull String columnName, Double def);
Get the Double value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | Double | - | (optional) Returned if the column has no value in this row |
Returns: Double — the value of the provided column name in this row
getFloat
Float getFloat(@NotNull String columnName) throws DatabaseException;
Float getFloat(@NotNull String columnName, Float def);
Get the Float value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | Float | - | (optional) Returned if the column has no value in this row |
Returns: Float — the value of the provided column name in this row
getBoolean
Boolean getBoolean(@NotNull String columnName) throws DatabaseException;
Boolean getBoolean(@NotNull String columnName, Boolean def);
Get the Boolean value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | Boolean | - | (optional) Returned if the column has no value in this row |
Returns: Boolean — the value of the provided column name in this row
getDate
Date getDate(@NotNull String columnName) throws DatabaseException;
Date getDate(@NotNull String columnName, Date def);
Get the <abbr title=java.sql.Date>Date</abbr> value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | <abbr title=java.sql.Date>Date</abbr> | - | (optional) Returned if the column has no value in this row |
Returns: <abbr title=java.sql.Date>Date</abbr> — the value of the provided column name in this row
getTimestamp
Timestamp getTimestamp(@NotNull String columnName) throws DatabaseException;
Timestamp getTimestamp(@NotNull String columnName, Timestamp def);
Get the <abbr title=java.sql.Timestamp>Timestamp</abbr> value of the provided column name in the represented row
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | @NotNull | Name of the targetted column |
def | <abbr title=java.sql.Timestamp>Timestamp</abbr> | - | (optional) Returned if the column has no value in this row |
Returns: <abbr title=java.sql.Timestamp>Timestamp</abbr> — the value of the provided column name in this row
isEmpty
boolean isEmpty();
See if the row is empty
Returns: boolean — true if the row has no column values
entrySet
Set<Map.Entry<String, Object>> entrySet();
Get the entry set of the row map
Returns: Set<Map.Entry<String, Object>> — the entry set of the row map
asMap
Map<String, Object> asMap();
Get the row map
Returns: Set<Map.Entry<String, Object>> — the row map
copy
implemented from Copyable.java
T: SelectionResult