Package com.sap.cloud.sdk.result
Interface ResultObject
- All Superinterfaces:
ResultElement
- All Known Implementing Classes:
GsonResultObject
Interface representing one structured object (e.g one complex business object) resulting from a call to an external
service (e.g. after invoking a BAPI or a remote-enabled function module).
Use the method get(String)
to access one particular element inside this object as ResultElement
.
Use the method as(Class)
to cast this object into a given class type.
-
Method Summary
Modifier and TypeMethodDescription<T> T
Returns thisResultObject
casted into the given typeT
.<T> T
Returns thisResultObject
casted into the given typeT
.Returns one particular element inside this result object identified by its name.Methods inherited from interface com.sap.cloud.sdk.result.ResultElement
asBigDecimal, asBigInteger, asBoolean, asByte, asCharacter, asDouble, asFloat, asInteger, asLong, asShort, asString, getAsCollection, getAsObject, getAsPrimitive, isResultCollection, isResultObject, isResultPrimitive
-
Method Details
-
get
Returns one particular element inside this result object identified by its name.- Parameters:
elementName
- Name of the requested element.- Returns:
- The found element as
ResultElement
. - Throws:
UnsupportedOperationException
- If requested element cannot be found within this object.
-
as
Returns thisResultObject
casted into the given typeT
.- Type Parameters:
T
- The type the result object shall be casted to.- Parameters:
objectType
- TheClass
type of the typeT
- Returns:
- An instance of
T
. - Throws:
UnsupportedOperationException
- If the cast into the given object type failed.
-
as
Returns thisResultObject
casted into the given typeT
.- Type Parameters:
T
- The type the result object shall be casted to.- Parameters:
objectType
- TheType
of the typeT
- Returns:
- An instance of
T
. - Throws:
UnsupportedOperationException
- If the cast into the given object type failed.
-