java.lang.Object
java.lang.Record
org.litebridgedb.orm.expression.intent.ConvertIntent<T>
- All Implemented Interfaces:
ExpressionModifier,TypeOverride<T>
public record ConvertIntent<T>(ExpressionSpec[] target, Class<T> returnType)
extends Record
implements ExpressionModifier, TypeOverride<T>
Intent to convert a database result into the specified Java type.
This uses Litebridge's registered type converter to perform the conversion;
it is not a database operation via creation of a ConvertSpec.
This specific intent class is designed to help with a fluent API flow
via the Litebridge.select(TypeOverride)
select API.
-
Constructor Summary
ConstructorsConstructorDescriptionConvertIntent(ExpressionSpec[] target, Class<T> returnType) Creates an instance of aConvertIntentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thereturnTyperecord component.target()Returns the value of thetargetrecord component.Get anExpressionSpecinstance that represents this modifier.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConvertIntent
Creates an instance of aConvertIntentrecord class.- Parameters:
target- the value for thetargetrecord componentreturnType- the value for thereturnTyperecord component
-
-
Method Details
-
toExpression
Description copied from interface:ExpressionModifierGet anExpressionSpecinstance that represents this modifier.- Specified by:
toExpressionin interfaceExpressionModifier- Returns:
- an
ExpressionSpecrepresenting this modifier.
-
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
public final int 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). -
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
returnType
Returns the value of thereturnTyperecord component.- Specified by:
returnTypein interfaceTypeOverride<T>- Returns:
- the value of the
returnTyperecord component
-