T
- class type of target object for extraction (deserialization)public class PrimitiveBasedObjectExtractor<T> extends Object implements ObjectExtractor<T>
ObjectExtractor
interface, offering a method to create an object by
extracting arbitrary input data of type ResultElement
. The created object will be of the same target type as
declared in the PrimitiveBasedObjectExtractor
class constructor. The target type will be dynamically checked
for parametrized constructors which fit the given input data. A fitting constructor will be used for object creation.
This implementation will only support extraction of ResultPrimitive
.
Constructors with primitive parameters are prioritized.
Constructor and Description |
---|
PrimitiveBasedObjectExtractor(Class<T> objectType) |
Modifier and Type | Method and Description |
---|---|
T |
extract(ResultElement resultElement)
Extracts the value of the given
ResultElement as the type T . |
@Nonnull public T extract(@Nonnull ResultElement resultElement)
ObjectExtractor
ResultElement
as the type T
.extract
in interface ObjectExtractor<T>
resultElement
- The ResultElement
to transform.resultElement
as the given type.Copyright © 2019 SAP SE. All rights reserved.