java.lang.Object
java.lang.Record
org.itsallcode.jdbc.resultset.generic.ColumnValue
- Record Components:
type
- column typevalue
- column value
Represents a generic column value.
-
Constructor Summary
ConstructorsConstructorDescriptionColumnValue
(ColumnType type, Object value) Creates an instance of aColumnValue
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Get the column value as a string.getValue()
Get the column value as an object.<T> T
Get the column value cast to the given type.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
Method Details
-
getValue
Get the column value cast to the given type.- Type Parameters:
T
- result type- Parameters:
type
- expected type- Returns:
- value of the given type
-
getValue
Get the column value as an object.- Returns:
- column value
-
getString
Get the column value as a string.- Returns:
- column value as string
-
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)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-