3.6. Dynamic path usage

For dynamic path generation the PathBuilder class can be used. It extends PEntity and can be used as an alternative to class generation and alias-usage for path generation.

String property :

PathBuilder<User> entityPath = new PathBuilder<User>(User.class, "entity");
// fully generic access
entityPath.get("userName");
// .. or with supplied type
entityPath.get("userName", String.class);
// .. and correct signature
entityPath.getString("userName").lower();

List property :

entityPath.getList("list", String.class, PString.class).get(0).lower();
entityPath.getList("list", String.class).get(0);

Map property :

entityPath.getMap("map", String.class, String.class, PString.class).get("key").lower();
entityPath.getMap("map", String.class, String.class).get("key");