Package io.vertigo.core.lang
Interface BasicTypeAdapter<J,B>
-
- Type Parameters:
J
- JavaDataType (ex : Mail, Point)B
- PrimitiveDataType (ex : String, Integer)
public interface BasicTypeAdapter<J,B>
This class adapts a non compliant java type to a compliant SQL java type. Primitive <=========> Java PrimitiveDataType <=Adapter=> JavaDataType) By default only a few types are allowed - Integer, Long, Double, BigDecimal - Boolean - String - LocalDate, Instant - DataStream If you want to store another value type like 'mail' you have to define a specific adapter. This Adapter MUST handle null value.- Author:
- pchretien
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BasicType
getBasicType()
ex : String, Integer....B
toBasic(J javaValue)
Mail -> StringJ
toJava(B basicValue, Class<J> javaType)
String -> Mail
-
-
-
Method Detail
-
toJava
J toJava(B basicValue, Class<J> javaType)
String -> Mail- Parameters:
primitiveValue
- the stored valuejavaType
- ex : Mail, Point...- Returns:
- the value transformed in POJO
-
toBasic
B toBasic(J javaValue)
Mail -> String- Parameters:
javaValue
- the pojo nullable value- Returns:
- the value transformed in a basicType ex : String, Integer....
-
getBasicType
BasicType getBasicType()
ex : String, Integer....- Returns:
- the BasicType
-
-