public class CustomRepresentationRestorer extends java.lang.Object implements RepresentationRestorer
RepresentationRestorers implemented via a restorer function.| Modifier and Type | Field and Description |
|---|---|
protected java.util.function.Function<? super Representation,?> |
restorer
Maps a representation back to the corresponding object (restores the object).
|
| Constructor and Description |
|---|
CustomRepresentationRestorer(java.util.function.Function<? super Representation,?> restorer)
Creates a restorer using the given restorer function.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
restoreFromRepresentation(java.lang.reflect.Type type,
Representation repr)
Takes a representation and creates an object of the given type from it if the type is supported by the restorer.
|
protected final java.util.function.Function<? super Representation,?> restorer
public CustomRepresentationRestorer(java.util.function.Function<? super Representation,?> restorer)
restorer - the restorer function to usepublic java.lang.Object restoreFromRepresentation(java.lang.reflect.Type type,
Representation repr)
RepresentationRestorerrestoreFromRepresentation in interface RepresentationRestorertype - tells the restorer which type the restored object should haverepr - the representation to restore the object from