public class AsMappable
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AsMappable.CoercedMappable |
Constructor and Description |
---|
AsMappable() |
Modifier and Type | Method and Description |
---|---|
static Mappable |
asMappable(java.lang.Object toCoerce)
Convert supplied object to a Mappable instance.
|
public static Mappable asMappable(java.lang.Object toCoerce)
Map<String,?> map = AsMappable.asMappable(new MyEntity(10,"hello")).toMap();
assertThat(map.get("num"),equalTo(10));
assertThat(map.get("str"),equalTo("hello"));
toCoerce
- Object to convert to a Mappable