Skip to content
AndyNoob edited this page May 11, 2023 · 3 revisions

Basic usage

To start using Mapable's bare bone functions, it is recommended to instantiate a Mapable instance with the MapableBuilder. For example:

final Mapable mapable = new MapableBuilder().createMapable();

Then, say the class we want to map is this:

class MapMePls {
    private int count = 10;
    private boolean isBigDawg = true;
    private double iq = -1;
}

All that is required is:

final MapMePls mapMePls = /* da instance */;
final Map<String, Object> mapped = mapable.asMap(mapMePls, /* optional but recommended */ MapMePls.class);

Which should output:

{/* expect the full class name here with the key "==" */, count=10, iq=-1.0, isBigDawg=true}
Clone this wiki locally