T - The type whose properties are to be mapped.@FunctionalInterface public interface Mapping<T>
Map.| Modifier and Type | Interface and Description |
|---|---|
static class |
Mapping.Builder<T>
Defines a builder for the declarative creation of a
Mapping. |
| Modifier and Type | Method and Description |
|---|---|
static <T> Mapping.Builder<T> |
add(String name,
Function<T,Object> getter)
Creates a new
Mapping.Builder and adds a link between name and getter method, which represents a property
of the associated type. |
TargetOperation<Map<String,Object>> |
map(T origin)
Results in a
TargetOperation for a given origin instance of the associated type,
which can map its properties into a Map. |
default Map<String,Object> |
toMap(T origin)
Convenience method that maps the properties of a given origin instance of the associated type to a new,
empty
Map and returns it. |
static <T> Mapping.Builder<T> add(String name, Function<T,Object> getter)
Mapping.Builder and adds a link between name and getter method, which represents a property
of the associated type.T - The type whose properties are to be mapped.TargetOperation<Map<String,Object>> map(T origin)
TargetOperation for a given origin instance of the associated type,
which can map its properties into a Map.Copyright © 2021 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.