Converts bean to product type (case class) and backwards.
Represents an ability to convert bean of type B to generic representation (shapeless.HList).
Represents an ability to convert bean of type B to generic representation (shapeless.HList). This is almost the same with shapeless.Generic, but for JavaBeans. E.g:
public class Cat { private String name; private int age; public String getName() { return name }; public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
Then the BeanGeneric instance will have Repr
= String :: Int :: HNil
. Note that the HList
order is the same with the bean properties getters declaration order.
Now it's possible to convert bean to HList, and then convert HList to something else.
the bean type
Represents ability to extract labels, like shapeless.DefaultSymbolicLabelling but for JavaBeans.
Represents ability to extract labels, like shapeless.DefaultSymbolicLabelling but for JavaBeans.
bean to extract labels
Converter between Java and Scala types.
Converter between Java and Scala types.
Built in instances to convert Java Integer, Long, Float, Double, BigDecimal, BigInteger,
Character, Boolean to corresponding Scala types are provided. If the Java value is null,
throws a NullPointerException. There is a converter from any type which can be mapped to
Option. For example you can map Integer
to Option[Int]
, or String
to Option[String].
It also supports HLists. E.g. you can convert Integer :: String :: HNil
to
Option[Int] :: String :: HNil
.
Java type
Scala type
Similar to BeanGeneric, but like shapeless.LabelledGeneric adds field names information to Repr.
Similar to BeanGeneric, but like shapeless.LabelledGeneric adds field names information
to Repr. Field names are calculated from getters. E.g getLoginDate
become loginDate
, and isActive
become active
.
For the bean from the BeanGeneric example the Repr type will be 'name -> String :: 'age -> Int :: HNil
.
bean type
Converts bean to product type (case class) and backwards.
Converts bean to product type (case class) and backwards.
Doesn't care about fields order. Only requires that the fields have same type and same name.
bean type
product type type
The companion object for BeanGeneric trait providing the way to obtain BeanGeneric instances.
Companion for LabelledBeanGeneric.
Companion for LabelledBeanGeneric. Provides ability to obtain an instance of LabelledBeanGeneric.
Converts bean to product type (case class) and backwards.
Doesn't care about fields order. The fields have to have compatible types.
bean type
product type type
LabelledBeanGeneric, JavaTypeMapper