Mapper.DTO Reference
Mapper.DTO is a wrapper object for nested maps.
Mapper.DTO d = new Mapper.DTO();
d.setObject('a.b.c', 'test');
Boolean flag = d.getBoolean('task.terminated');
Mapper.DTO is a wrapper object for nested maps.
Mapper.DTO d = new Mapper.DTO();
d.setObject('a.b.c', 'test');
Boolean flag = d.getBoolean('task.terminated');
Here are the constructors.
Constructor | Description |
---|---|
DTO() | Constrcutor to create an empty DTO |
DTO(DTO) | Constructor to create an instance from another DTO |
DTO(String) | Constructor to create an instance from a JSON string |
DTO(Map | Constructor to create an instance from a Map |
DTO(SObject) | Constructor to create an instance from an SObject |
DTO(Object) | Constrcutor to create an instance from an Object |
Mapper.DTO d = new MapperDTO();
Here are the query APIs.
Method | Description |
---|---|
keySet() | Get the keys of the DTO |
containsPath(List | Check if the DTO has the path |
containsPath(String) | Check if the DTO has the path |
Here are the methods to convert DTO to other objects.
Method | Description |
---|---|
toMap() | Convert to Map |
toJSON() | Convert to JSON string |
toObject(Type) | Convert to Object of the given type |
toSObject(Type) | Convert to SObject of the given type |
Mapper.DTO d = new MapperDTO();
Map m = d.toMap();
Here are the getters/setters for DTOs.
Method | Description |
---|---|
setObject(List | Set the value at the path |
setObject(String, Object) | Set the value at the path |
getObject(List | Get the value at the path |
getObject(String) | Get the value at the path |
setBoolean(List | Set the value at the path |
setBoolean(String, Object) | Set the value at the path |
getBoolean(List | Get the value at the path |
getBoolean(String) | Get the value at the path |
setInteger(List | Set the value at the path |
setInteger(String, Object) | Set the value at the path |
getInteger(List | Get the value at the path |
getInteger(String) | Get the value at the path |
setLong(List | Set the value at the path |
setLong(String, Object) | Set the value at the path |
getLong(List | Get the value at the path |
getLong(String) | Get the value at the path |
setDouble(List | Set the value at the path |
setDouble(String, Object) | Set the value at the path |
getDouble(List | Get the value at the path |
getDouble(String) | Get the value at the path |
setDecimal(List | Set the value at the path |
setDecimal(String, Object) | Set the value at the path |
getDecimal(List | Get the value at the path |
getDecimal(String) | Get the value at the path |
setString(List | Set the value at the path |
setString(String, Object) | Set the value at the path |
getString(List | Get the value at the path |
getString(String) | Get the value at the path |
setList(List | Set the value at the path |
setList(String, Object) | Set the value at the path |
getList(List | Get the value at the path |
getList(String) | Get the value at the path |
setSet(List | Set the value at the path |
setSet(String, Object) | Set the value at the path |
getSet(List | Get the value at the path |
getSet(String) | Get the value at the path |
setMap(List | Set the value at the path |
setMap(String, Object) | Set the value at the path |
getMap(List | Get the value at the path |
getMap(String) | Get the value at the path |
setSObject(List | Set the value at the path |
setSObject(String, Object) | Set the value at the path |
getSObject(List | Get the value at the path |
getSObject(String) | Get the value at the path |
setDate(List | Set the value at the path |
setDate(String, Object) | Set the value at the path |
getDate(List | Get the value at the path |
getDate(String) | Get the value at the path |
setTime(List | Set the value at the path |
setTime(String, Object) | Set the value at the path |
getTime(List | Get the value at the path |
getTime(String) | Get the value at the path |
setDatetime(List | Set the value at the path |
setDatetime(String, Object) | Set the value at the path |
getDatetime(List | Get the value at the path |
getDatetime(String) | Get the value at the path |
setFunc(List | Set the value at the path |
setFunc(String, Object) | Set the value at the path |
getFunc(List | Get the value at the path |
getFunc(String) | Get the value at the path |
Mapper.DTO d = new MapperDTO();
d.setInteger('age', 30);
Contribute on Github! Edit this section.