Module org.itsallcode.jdbc
Record Class SimpleMetaData
java.lang.Object
java.lang.Record
org.itsallcode.jdbc.resultset.generic.SimpleMetaData
- Record Components:
columns
- all column metadata for the result set
A wrapper for
ResultSetMetaData
to simplify usage.-
Constructor Summary
ConstructorsConstructorDescriptionSimpleMetaData
(List<ColumnMetaData> columns) Creates an instance of aSimpleMetaData
record class. -
Method Summary
Modifier and TypeMethodDescriptioncolumns()
Returns the value of thecolumns
record component.static SimpleMetaData
Create a newSimpleMetaData
for a givenResultSet
.final boolean
Indicates whether some other object is "equal to" this one.getColumnByIndex
(int index) Get column metadata for a given index (one based).final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
SimpleMetaData
Creates an instance of aSimpleMetaData
record class.- Parameters:
columns
- the value for thecolumns
record component
-
-
Method Details
-
create
Create a newSimpleMetaData
for a givenResultSet
.- Parameters:
resultSet
- the result set- Returns:
- simple metadata
-
getColumnByIndex
Get column metadata for a given index (one based).- Parameters:
index
- column index (one based)- Returns:
- column metadata
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
columns
Returns the value of thecolumns
record component.- Returns:
- the value of the
columns
record component
-