public interface ResultElement
Note that accessing the result element varies depending on its structure:
ResultPrimitive
. ResultObject
. ResultCollection
. isResultPrimitive()
, isResultObject()
, or isResultCollection()
to check
for the respective case.
As accessing the content of the result element varies depending on its structure, use the methods
getAsPrimitive()
, getAsObject()
, or getAsCollection()
to access the result element
content.
If the result element is considered a ResultPrimitive
, its content can be accessed with the respective method
directly, such as asString()
to obtain the result element content as String object.
Modifier and Type | Method and Description |
---|---|
BigDecimal |
asBigDecimal()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as BigDecimal . |
BigInteger |
asBigInteger()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as BigInteger . |
boolean |
asBoolean()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as boolean . |
byte |
asByte()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as byte . |
char |
asCharacter()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as char . |
double |
asDouble()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as double . |
float |
asFloat()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as float . |
int |
asInteger()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as int . |
long |
asLong()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as long . |
short |
asShort()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as short . |
String |
asString()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as String . |
ResultCollection |
getAsCollection()
Returns this
ResultElement as an instance of ResultCollection . |
ResultObject |
getAsObject()
Returns this
ResultElement as an instance of ResultObject . |
ResultPrimitive |
getAsPrimitive()
Returns this
ResultElement as an instance of ResultPrimitive . |
boolean |
isResultCollection()
Checks whether this
ResultElement represents a collection of result elements and, therefore, is a
ResultCollection . |
boolean |
isResultObject()
Checks whether this
ResultElement represents a structured object and, therefore, is a
ResultObject . |
boolean |
isResultPrimitive()
Checks whether this
ResultElement represents an unstructured value and, therefore, is a
ResultPrimitive . |
boolean isResultPrimitive()
ResultElement
represents an unstructured value and, therefore, is a
ResultPrimitive
.ResultPrimitive
, otherwise falseboolean isResultCollection()
ResultElement
represents a collection of result elements and, therefore, is a
ResultCollection
.ResultCollection
, otherwise falseboolean isResultObject()
ResultElement
represents a structured object and, therefore, is a
ResultObject
.ResultObject
, otherwise falseResultPrimitive getAsPrimitive() throws UnsupportedOperationException
ResultElement
as an instance of ResultPrimitive
.ResultPrimitive
UnsupportedOperationException
- If the cast into ResultPrimitive
failed, e.g. in case it is not a primitiveResultCollection getAsCollection() throws UnsupportedOperationException
ResultElement
as an instance of ResultCollection
.ResultCollection
UnsupportedOperationException
- If the cast into ResultCollection
failed, e.g. in case it is not a collectionResultObject getAsObject() throws UnsupportedOperationException
ResultElement
as an instance of ResultObject
.ResultObject
UnsupportedOperationException
- If the cast into ResultObject
failed, e.g. in case it is not an objectboolean asBoolean() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as boolean
.boolean
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as boolean
byte asByte() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as byte
.byte
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as byte
char asCharacter() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as char
.char
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as char
String asString() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as String
.String
objectUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as String
int asInteger() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as int
.int
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as int
short asShort() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as short
.short
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as short
long asLong() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as long
.long
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as long
float asFloat() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as float
.float
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as float
double asDouble() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as double
.double
valueUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as double
BigInteger asBigInteger() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as BigInteger
.BigInteger
objectUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as BigInteger
BigDecimal asBigDecimal() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as BigDecimal
.BigDecimal
objectUnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as BigDecimal
Copyright © 2018 SAP SE. All rights reserved.