Interface TypeConverter<T>
- All Known Subinterfaces:
LiteralFunctionTypeConverter<T>
- All Known Implementing Classes:
InstantTypeConverter,LocalDateTimeTypeConverter,LocalDateTypeConverter,LocalTimeTypeConverter,OffsetDateTimeTypeConverter,OffsetTimeTypeConverter,ZonedDateTimeTypeConverter
public interface TypeConverter<T>
A contract for converting values of one type to another as well as rendering as JPQL literal.
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendTo(T value, StringBuilder stringBuilder) Appends the JPQL literal representation of the given value to the given string builder.Converts the given value to the type for which the converter was registered.Returns the JPQL literal representation of the given value as string.
-
Method Details
-
convert
Converts the given value to the type for which the converter was registered.- Parameters:
value- The value to convert.- Returns:
- The converted value
- Throws:
IllegalArgumentException- If the conversion is not possible
-
toString
Returns the JPQL literal representation of the given value as string.- Parameters:
value- The value- Returns:
- The JPQL literal
-
appendTo
Appends the JPQL literal representation of the given value to the given string builder.- Parameters:
value- The valuestringBuilder- The string builder
-